Skip to content

Instantly share code, notes, and snippets.

View schrink's full-sized avatar

Vladimir Lelicanin schrink

View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@schrink
schrink / async-await.js
Created February 16, 2018 23:47 — forked from wesbos/async-await.js
Simple Async/Await Example
// 🔥 Node 7.6 has async/await! Here is a quick run down on how async/await works
const axios = require('axios'); // promised based requests - like fetch()
function getCoffee() {
return new Promise(resolve => {
setTimeout(() => resolve('☕'), 2000); // it takes 2 seconds to make coffee
});
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<h1>Naslov</h1>
@schrink
schrink / gist:c9fc38b7a3bd18bbf42ffac047c84163
Created December 2, 2016 10:06 — forked from scmx/upgrade-install-ruby-2-1-2-ubuntu-12-04.md
Upgrade/Install ruby 2.1.2 #ubuntu #12.04 #14.04
# Reference http://stackoverflow.com/a/18490935/2037928
# Login as root
# Install needed packages
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev
cd /tmp
# Download appropriate ruby version https://www.ruby-lang.org/en/downloads/
<form>
<div class="form-group">
<label for="ime">Ime</label>
<input type="text" class="form-control" id="ime" name="ime">
</div>
<button type="submit" class="btn btn-default">Submit</button>
</form>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Hello World</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.12.2/react.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.12.2/JSXTransformer.js"></script>
</head>
<body>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
@schrink
schrink / index.html
Created November 28, 2014 23:25
Overlay // source http://jsbin.com/siyuw
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-2.1.1.min.js"></script>
<meta charset="utf-8">
<title>Overlay</title>
<style id="jsbin-css">
#over {
position: fixed; /* ovo je jako vazno da ne stavite absolute jer absolute ne pokrije ceo viewport*/
display: none;
@schrink
schrink / index.html
Created November 28, 2014 19:38
Overlay Div // source http://jsbin.com/siyuw
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-2.1.1.min.js"></script>
<meta charset="utf-8">
<title>Overlay</title>
<style id="jsbin-css">
#over {
position: fixed; /* ovo je jako vazno da ne stavite absolute jer absolute ne pokrije ceo viewport*/
display: none;
@schrink
schrink / gist:7830804
Created December 6, 2013 19:33
JS AJAX
function category_ajax( type, selected ){
jQuery.ajax({
type: 'POST',
url: window.location.protocol + "//" + window.location.host + "/" + "wp-admin/admin-ajax.php",
data:{
'action':'do_ajax',
'fn':'pd_get_products',
'category': selected
},
beforeSend:function(xhr){