Skip to content

Instantly share code, notes, and snippets.

@aponxi
aponxi / Git push deployment in 7 easy steps.md
Created May 1, 2018 01:50 — forked from thomasfr/Git push deployment in 7 easy steps.md
7 easy steps to automated git push deployments. With small and configurable bash only post-receive hook

HOW TO CREATE A SIMPLE JAVASCRIPT LIBRARY IN JQUERY STYLE

https://bjarneo.codes/how-to-create-a-simple-javascript-library-like-jquery/

In this blog post I’ll show you a simple approach to create a JavaScript library that uses the same syntax as jQuery called method chaining. Lets call our library Q.

Example of how we could use Q: Q(‘.class’).hide();

Why?

You may think “why the heck would I need to create my own library when we got jQuery”, and the answer is simple. YOU DO NOT NEED TO USE JQUERY FOR EVERYTHING. If you’re eager to learn how JavaScript actually work, and/or you’re creating a small application, use your own code and test it in different browsers / browser versions.

@aponxi
aponxi / some.router.js
Last active April 26, 2017 16:57
Node JS Express Cookie Snippet
//use npm install cookie-parser --save
//put the following snippet inside a route like: router.post('/save', function (req, res, next) {
//set cookie
var cookie = req.cookies['profile_id'];
if (cookie === undefined) {
try {
res.cookie('profile_id', profile_id, {
path : '/survey',
expires : new Date(Date.now() + 900000),
httpOnly : false
@aponxi
aponxi / neo4j_cypher_cheatsheet.md
Created April 24, 2017 15:25 — forked from DaniSancas/neo4j_cypher_cheatsheet.md
Neo4j's Cypher queries cheatsheet

Neo4j Tutorial

Fundamentals

Store any kind of data using the following graph concepts:

  • Node: Graph data records
  • Relationship: Connect nodes (has direction and a type)
  • Property: Stores data in key-value pair in nodes and relationships
  • Label: Groups nodes and relationships (optional)
// Because we want to access DOM node,
// we initialize our script at page load.
window.addEventListener('load', function () {
// This variables will be used to store the form data
var text = document.getElementById("i1");;
var file = {
dom : document.getElementById("i2"),
binary : null
};
@bendc
bendc / supportsES6.js
Created August 25, 2016 08:05
Test if ES6 is ~fully supported
var supportsES6 = function() {
try {
new Function("(a = 0) => a");
return true;
}
catch (err) {
return false;
}
}();
@noelboss
noelboss / git-deployment.md
Last active April 1, 2025 16:56
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

@DaniSancas
DaniSancas / neo4j_cypher_cheatsheet.md
Created June 14, 2016 23:52
Neo4j's Cypher queries cheatsheet

Neo4j Tutorial

Fundamentals

Store any kind of data using the following graph concepts:

  • Node: Graph data records
  • Relationship: Connect nodes (has direction and a type)
  • Property: Stores data in key-value pair in nodes and relationships
  • Label: Groups nodes and relationships (optional)
@aponxi
aponxi / index.html
Created October 18, 2014 23:00
Bootstrap 3.2 and Font Awesome 4.2.0 Minimal Templates for HTML and Jade
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootstrap 101 Template</title>
<!-- Bootstrap -->
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet">
@cblanc
cblanc / gist:46ebbba6f42f61e60666
Created September 22, 2014 20:36
First 1000 Prime Numbers (CSV)
2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997,1009,1013,1019,1021,1031,1033,1039,1049,1051,1061,1063,1069,1087,1091,1093,1097,1103,1109,1117,1123,1129,1151,1153,1163,1171,1181,1187,1193,1201,1213,1217,1223,1229,1231,1237,1249,1259,1277,1279,1283,1289,1291,1297,1301,1303,1307,1319,1321,1327,1361,1367,1373,1381,1399,1409,1423,1427,1429,1433,1439,1447,1451,1453,1459,1471,1481,1483,1487,1489,1493,1499,1511,1523,1531,1543,1549,1