Skip to content

Instantly share code, notes, and snippets.

@jsbain
jsbain / gistcheck.py
Created March 25, 2015 06:15
updated for ios8
# Source: https://gist.github.com/5212628
#
# All-purpose gist tool for Pythonista.
#
# When run directly, this script sets up four other scripts that call various
# functions within this file. Each of these sub-scripts are meant for use as
# action menu items. They are:
#
# Set Gist ID.py - Set the gist id that the current file should be
# associated with.
@kyleskrinak
kyleskrinak / fix-perms.sh
Created February 11, 2014 02:34
A brutishly simple shell script that fixes drupal shared permissions (if you have shell access)
if [ -d "$1/sites" ]; then
cur_dir=`pwd`
echo $cur_dir
cd $1
echo `pwd`
echo "chmod directories"
find . -type d -exec chmod u=rwx,g=rx,o=rx {} \;
echo "chmod files"
find . -type f -exec chmod u=rw,g=r,o=r {} \;
echo "chmod sites/default/files"
@Angles
Angles / YoutubeDL.py
Last active January 12, 2016 04:57 — forked from pudquick/YoutubeDL.py
import urllib2, urlparse, sys, webbrowser
itags = {'45': 'webm_720p',
'44': 'webm_480p',
'43': 'webm_360p',
'38': 'mp4_3072p',
'37': 'mp4_1080p',
'36': 'phone_mp4_240p',
'35': 'flv_480p',
'34': 'flv_360p',
import urllib2, urlparse, sys, webbrowser
itags = {'45': 'webm_720p',
'44': 'webm_480p',
'43': 'webm_360p',
'38': 'mp4_3072p',
'37': 'mp4_1080p',
'36': 'phone_mp4_240p',
'35': 'flv_480p',
'34': 'flv_360p',
@annagapuz
annagapuz / OpenSSLCACreateAndSign
Last active December 10, 2015 23:49
OpenSSL Create Certificate Authority and sign certificate request
# Assumptions
- OpenSSL is installed
- base working directory is /usr/lib/ssl/misc
# Create new certificate authority, created in demoCA directory
sudo ./CA.pl -newca
# Sign a certificate request using CA created above
sudo openssl x509 -req -CA demoCA/cacert.pem -CAkey demoCA/private/cakey.pem -in newreq.pem -out localhost.cer -days 1460 -CAcreateserial
@sindresorhus
sindresorhus / github-email.sh
Created January 11, 2013 17:46
Magically retrieves a GitHub users email even though it's not publicly shown
#!/bin/bash
# Created by Sindre Sorhus
# Magically retrieves a GitHub users email even though it's not publicly shown
[ "$1" = "" ] && echo "usage: $0 <GitHub username> [<repo>]" && exit 1
[ "$2" = "" ] && repo=`curl "https://api.github.com/users/$1/repos?type=owner&sort=updated" -s | sed -En 's|"name": "(.+)",|\1|p' | tr -d ' ' | head -n 1` || repo=$2
curl "https://api.github.com/repos/$1/$repo/commits" -s | sed -En 's|"(email\|name)": "(.+)",?|\2|p' | tr -s ' ' | paste - - | sort -u -k 1,1
@ArnaudLigny
ArnaudLigny / github_repo.html
Last active December 10, 2015 23:49
Display Github repo list with javscript in HTML page.
<div class="github-repos span-9 last">
<h4>My Github Projects</h4>
<ul>
<li>Loading...</li>
</ul>
</div>
<div class="github-org-repos span-9 last">
<h4>Baobaz Github Projects</h4>
<ul>
<li>Loading...</li>
@DHuckaby
DHuckaby / NonsenseGenerator.java
Created October 30, 2012 13:26
This generator can construct headlines and news articles by randomly composing sentences.
/*
* Copyright (C) 2011 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
#!/usr/bin/env python
import datetime
import feedparser
import json
import os
from urlparse import urlparse
def readConfigFile():
"""Read the config file ~/.youtube-rss and return a dictionary"""
@testingbot
testingbot / python_parallel_webdriver.py
Created August 3, 2012 16:36
python parallel webdriver testing on testingbot
from threading import Thread
from selenium import webdriver
import time
API_KEY = "key"
API_SECRET = "secret"
def get_browser(caps):
return webdriver.Remote(
desired_capabilities=caps,