Skip to content

Instantly share code, notes, and snippets.

@betawax
betawax / gist:1053967
Last active May 24, 2024 09:45
Git cheat sheet

Git cheat sheet

Common commands

General

Create repository:

git init
@sente
sente / formatXML.js
Last active April 4, 2024 12:20
javascript to format/pretty-print XML
The MIT License (MIT)
Copyright (c) 2016 Stuart Powers
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@itorres
itorres / ssha.js
Created June 18, 2012 06:10
node.js ssha hash generation and check functions intended for use with LDAP servers.
var crypto = require('crypto');
/*
* node.js ssha hash generation and check functions intended for use with LDAP servers.
*/
function ssha(cleartext, salt) {
var sum = crypto.createHash('sha1');
( typeof(salt) == 'undefined') ? salt = new Buffer(crypto.randomBytes(20)).toString('base64') : salt = salt;
sum.update(cleartext);
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active June 29, 2024 08:12
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@pitch-gist
pitch-gist / gist:2999707
Created June 26, 2012 22:21
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@alexjs
alexjs / cors-nginx.conf
Created November 28, 2012 22:42 — forked from michiel/cors-nginx.conf
Slightly tighter CORS config for nginx
#
# Slightly tighter CORS config for nginx
#
# A modification of https://gist.github.com/1064640/ to include a white-list of URLs
#
# Despite the W3C guidance suggesting that a list of origins can be passed as part of
# Access-Control-Allow-Origin headers, several browsers (well, at least Firefox)
# don't seem to play nicely with this.
#
@bingomanatee
bingomanatee / JSONObject.cs
Created November 5, 2013 20:36
the JSONObject component. Taken from the Unity Wiki
#define PRETTY //Comment out when you no longer need to read JSON to disable pretty print system-wide
#define USEFLOAT //Use floats for numbers instead of doubles (enable if you're getting too many significant digits in string output)
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
/*
* http://www.opensource.org/licenses/lgpl-2.1.php
* JSONObject class
@raultm
raultm / commands.sh
Created November 11, 2013 23:05
Commands to convert Mavericks installer in Mavericks ISO Source : http://thezinx.com/2013/10/29/create-bootable-dmg-iso-mavericks-app.html
# Source : http://thezinx.com/2013/10/29/create-bootable-dmg-iso-mavericks-app.html
# Mount the installer image
hdiutil attach /Applications/Install\ OS\ X\ Mavericks.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app
# Convert the boot image to a sparse bundle
hdiutil convert /Volumes/install_app/BaseSystem.dmg -format UDSP -o /tmp/Mavericks
# Increase the sparse bundle capacity to accommodate the packages
hdiutil resize -size 8g /tmp/Mavericks.sparseimage
@denji
denji / README.md
Last active April 26, 2024 18:09 — forked from istepanov/gist:3950977
Remove/Backup – settings & cli for macOS (OS X) – DataGrip, AppCode, CLion, Gogland, IntelliJ, PhpStorm, PyCharm, Rider, RubyMine, WebStorm