Skip to content

Instantly share code, notes, and snippets.

View skopp's full-sized avatar

Rashaad Essop skopp

View GitHub Profile
var gistPrefix = 'http://gist.github.com/',
// Cache document.write so that it can be restored once all Gists have been
// embedded.
cachedWrite = document.write,
body = $('body'),
// Map each p.gist to an object that contains the paragraph to be replaced
// and the Gist's identifier.
gists = $('p.gist').map(function(n, p) {
p = $(p);
@skopp
skopp / lostgeneration.md
Last active December 18, 2015 20:49
lost generation_jonathan reed

I am part of a lost generation

and I refuse to believe that
I can change the world
I realize this may be a shock but
“Happiness comes from within.”
is a lie, and
“Money will make me happy.”
So in 30 years I will tell my children
they are not the most important thing in my life
My employer will know that

@skopp
skopp / kd-dropbox.markdown
Last active December 18, 2015 20:29
No root/sudo needed! How to install a Dropbox daemon using the dropbox.py script as a CLI controller - a 'plan B' to the migrator.kdapp or vague 'wget' suggestion - on koding.com.

old => new kd:

This section may be ignored ; just leaving it here as it may apply still for a while - it referred to migrating from old to new kd (if you don't know what that even means, don't stress. Just jump to next section)]: it goes without saying that you have to deploy the daemon on both your old.koding as well as your new koding vm - the latter if you want to extract those data from within new kd itself


Init Terminal

Let it warm up if it's a cold morning.

  1. Download the linux x64 pkg: cd ~ && wget -O - "https://www.dropbox.com/download?plat=lnx.x86_64" | tar xzf -

# Python [PEP-8]:

Intermezzo: Coding Style

... (f)or Python, PEP 8 has emerged as the style guide that most projects adhere to; it promotes a very readable and eye-pleasing coding style. Every Python developer should read it at some point; here are the most important points extracted for you:

#!/usr/bin/env python
import os
import urllib2
import json
import subprocess
user=None
repo=None

#Create bitbucket branch

##Create local branch

$ git checkout -b sync
Switched to a new branch 'sync'
$ git branch
  master
* sync
javascript:(function({
var INSTAPAPER=true,w=window,d=document,pageSelectedTxt=w.getSelection?w.getSelection():(d.getSelection)?d.getSelection():(d.selection?d.selection.createRange().text:0),pageTitle=d.title,pageUri=w.location.href,tmplt="";
tmplt="From ["+pageTitle+"]("+pageUri+"):\n\n";
if(pageSelectedTxt!="") {
pageSelectedTxt=">%20"+pageSelectedTxt;
pageSelectedTxt=pageSelectedTxt.replace(/(\r\n|\n+|\r)/gm,"\n");
pageSelectedTxt=pageSelectedTxt.replace(/\n/g,"\n>%20\n>%20");
w.location.href="nvalt://make/?txt="+encodeURIComponent(tmplt+pageSelectedTxt)+"&title="+encodeURIComponent(pageTitle)
}
else {
@skopp
skopp / uhuruvcap
Created June 10, 2013 11:32
uhuru vcap sql
/* uhuru vcap
Hello You should not use credentials from your tunnel session in the cloud. After you delete the tunnel, that credentials get deleted. */
The way to do it, is read mysql connection details from the environment variable VCAP_SERVICES like this:
$services = getenv("VCAP_SERVICES");
$services_json = json_decode($services,true);
$mysql_config = $services_json["mysql-5.1"][0]["credentials"];
define('DB_NAME', $mysql_config["name"]);
define('DB_USER', $mysql_config["user"]);
define('DB_PASSWORD', $mysql_config["password"]);
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="description" content="HTTrack is an easy-to-use website mirror utility. It allows you to download a World Wide website from the Internet to a local directory,building recursively all structures, getting html, images, and other files from the server to your computer. Links are rebuiltrelatively so that you can freely browse to the local site (works with any browser). You can mirror several sites together so that you can jump from one toanother. You can, also, update an existing mirror site, or resume an interrupted download. The robot is fully configurable, with an integrated help" />
<meta name="keywords" content="httrack, HTTRACK, HTTrack, winhttrack, WINHTTRACK, WinHTTrack, offline browser, web mirror utility, aspirateur web, surf offline, web capture, www mirror utility, browse offline, local site builder, website mirroring, aspirateur www, internet grab
@skopp
skopp / regex.pl
Last active December 18, 2015 05:39
Perl / PHP regex
# Perl
and
# PHP
# RegEx
PHP regexes are based on the PCRE (Perl-Compatible Regular Expressions), so any regexp that works for one should be compatible with the other or any other language that makes use of the PCRE format. Here are some commonly needed regular expressions for both PHP and Perl. Each regex will be in string format and will include delimiters.
All Major Credit Cards
---