Skip to content

Instantly share code, notes, and snippets.

View a7madgamal's full-sized avatar

Ahmed Hassanein a7madgamal

View GitHub Profile
"atom-beautify":
prettyName: "Atom Beautify"
homepage: "https:/atom.io/packages/atom-beautify"
"atom-material-syntax-dark":
prettyName: "Atom Material Syntax Dark"
homepage: "https:/atom.io/packages/atom-material-syntax-dark"
"atom-material-ui":
prettyName: "Atom Material Ui"
homepage: "https:/atom.io/packages/atom-material-ui"

Go to the .git folder in your repo and open the file config. In the [core]section add the line

sparsecheckout = true then go to the folder .git/info and create the file sparse-checkout. Add something like

!this/path/will/be/ignored/* You should now be able to checkout the repo.

@a7madgamal
a7madgamal / reverse.sh
Created September 21, 2016 16:53
Reverse a stash apply
git stash show -p | git apply --reverse
@a7madgamal
a7madgamal / style.js
Last active September 16, 2016 10:08
Douglas crockford's js library coding style (not usable, learning purposes only)
var ADSAFE;
ADSAFE = (function () {
"use strict";
function error(message) {
ADSAFE.log("ADsafe error: " + (message || "ADsafe violation."));
}
return {
get: function (object, name) {
#!/bin/bash
fromExt=".jade"
toExt=".pug"
for file in $(find . -name '*'$fromExt);
do
mv -i -v "$file" "${file%$fromExt}$toExt"
done
kill -9 $(lsof -i:PORT_NUMBER -t)
#create hook script: /path/to/git/bare/repo/post-receive
#!/bin/bash
while read oldrev newrev ref
do
if [[ $ref =~ .*/master$ ]];
then
echo "pulling master"
git --work-tree=/path/to/working/dir --git-dir=/path/to/working/dir/.git pull origin master
else
@a7madgamal
a7madgamal / packages.cson
Created April 27, 2016 16:47
export file for atom's package sync https://atom.io/packages/package-sync
packages: [
"atom-beautify"
"atom-jade"
"atom-pair"
"autocomplete-paths"
"chary-tree-view"
"code-links"
"coffee-links"
"coffee-paste"
"editor-background"
@a7madgamal
a7madgamal / packages.cson
Created April 27, 2016 16:47
export file for atom's package sync
packages: [
"atom-beautify"
"atom-jade"
"atom-pair"
"autocomplete-paths"
"chary-tree-view"
"code-links"
"coffee-links"
"coffee-paste"
"editor-background"
@a7madgamal
a7madgamal / createBearerToken.js
Created April 14, 2016 17:02 — forked from elmariachi111/createBearerToken.js
A Javascript file that requests a Twitter bearer token for application only authentication (https://dev.twitter.com/docs/auth/application-only-auth). Depends on mikeals request library (https://github.com/mikeal/request) (npm install request)
var R = require("request");
var key = process.env.TWITTER_CONSUMER_KEY;
var secret = process.env.TWITTER_CONSUMER_SECRET;
var cat = key +":"+secret;
var credentials = new Buffer(cat).toString('base64');
var url = 'https://api.twitter.com/oauth2/token';
R({ url: url,