Skip to content

Instantly share code, notes, and snippets.

View yazz's full-sized avatar

Zubair Quraishi yazz

View GitHub Profile
@mherkender
mherkender / gist:3026572
Created July 1, 2012 02:43
Why ansible sucks
max@darmani% ansible-playbook -k -i ansible.hosts nabooru.ansible.yml
SSH password:
PLAY [nabooru] ****************************
SETUP PHASE ****************************
ok: [192.168.1.133]
function hello(name){
console.log("Hello " + name);
}
hello('node.js');
@domenic
domenic / promises.md
Last active March 31, 2024 14:07
You're Missing the Point of Promises

This article has been given a more permanent home on my blog. Also, since it was first written, the development of the Promises/A+ specification has made the original emphasis on Promises/A seem somewhat outdated.

You're Missing the Point of Promises

Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:

getTweetsFor("domenic", function (err, results) {
 // the rest of your code goes here.
@pewerner
pewerner / MSAcess.js
Created December 14, 2012 12:08
Query MS-Access Data-base from JS.
function AddRecord() {
//var adoConn = new ActiveXObject("ADODB.Connection");
var adoConn = new ActiveX("ADODB.Connection");
//var adoRS = new ActiveXObject("ADODB.Recordset");
var adoRS = new ActiveX("ADODB.Recordset");
adoConn.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source='/\dbName.mdb'");
adoRS.Open("Select * From tblName", adoConn, 1, 3);
adoRS.AddNew;
@19WAS85
19WAS85 / powershell-web-server.ps1
Last active May 24, 2024 15:47
A simple web server built with powershell.
# This is a super **SIMPLE** example of how to create a very basic powershell webserver
# 2019-05-18 UPDATE — Created by me and and evalued by @jakobii and the comunity.
# Http Server
$http = [System.Net.HttpListener]::new()
# Hostname and port to listen on
$http.Prefixes.Add("http://localhost:8080/")
# Start the Http Server
@mdnmdn
mdnmdn / ConvertTo-JSON.ps1
Last active January 2, 2022 14:10
ConvertTo-JSON for Powershell 2.0
function Escape-JSONString($str){
if ($str -eq $null) {return ""}
$str = $str.ToString().Replace('"','\"').Replace('\','\\').Replace("`n",'\n').Replace("`r",'\r').Replace("`t",'\t')
return $str;
}
function ConvertTo-JSON($maxDepth = 4,$forceArray = $false) {
begin {
$data = @()
}
@robschmuecker
robschmuecker / README.md
Last active May 13, 2024 20:57
D3.js Drag and Drop, Zoomable, Panning, Collapsible Tree with auto-sizing.

This example pulls together various examples of work with trees in D3.js.

The panning functionality can certainly be improved in my opinion and I would be thrilled to see better solutions contributed.

One can do all manner of housekeeping or server related calls on the drop event to manage a remote tree dataset for example.

Dragging can be performed on any node other than root (flare). Dropping can be done on any node.

Panning can either be done by dragging an empty part of the SVG around or dragging a node towards an edge.

@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active June 12, 2024 03:08
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

@runexec
runexec / Om Does Frontend Better.cljs.md
Last active January 23, 2018 17:09
Om and React.js Does It Better

Om and React.js Does It Better

A hopefully short and concise explanation as to how Om/React.js works. This probably isn't for you if you already use ClojureScript or Om.

The front end and JavaScript God known as David Nolen created a ClojureScript library called Om. Om is a front end library that uses React.js and makes web MVC not just obsolete, but an anti-pattern.

In Om there's just the data and the view.

  1. data =>