Skip to content

Instantly share code, notes, and snippets.

View qkdreyer's full-sized avatar
📱
Working

Quentin Dreyer qkdreyer

📱
Working
View GitHub Profile
@bgmort
bgmort / run_multiple_commands.py
Last active November 18, 2017 12:47
Cleaned up version of code posted at https://forum.sublimetext.com/t/run-multiple-commands-command/6848/35. Added support for repeated commands and example key mappings to move/scroll by ten lines.
# run_multiple_commands.py
import sublime, sublime_plugin
# Takes an array of commands (same as those you'd provide to a key binding) with
# an optional context (defaults to view commands) & runs each command in order.
# Valid contexts are 'text', 'window', and 'app' for running a TextCommand,
# WindowCommands, or ApplicationCommand respectively.
class RunMultipleCommandsCommand(sublime_plugin.TextCommand):
def exec_command(self, command):
if not 'command' in command:
raise Exception('No command name provided.')
@KevinKelchen
KevinKelchen / Xcode8AutomaticSigning.md
Last active May 7, 2019 13:04
iOS Xcode 8 Automatic Signing Identity and Provisioning Setup

iOS Xcode 8 Automatic Signing Identity and Provisioning Setup

These are the steps our team used to get Xcode 8's Automatic Signing working for our iOS app. We felt it would be valuable to share this with the community (particularly given the effort it required us to get it working). While our research yielded some valuable information from others, it wasn't as simple as it sounded. We figured that we're not alone. 😄

For reference, these were some of the resources that proved valuable to us:

These steps presume that you have some understanding of iOS code signing and familiarity w

@BrendanEich
BrendanEich / gist:5753666
Created June 11, 2013 00:36
ES6 version of Peter Norvig's Sudoku solver originally written in Python
// XXX should be standard (and named clone, after Java?)
Object.prototype.copy = function () {
let o = {}
for (let i in this)
o[i] = this[i]
return o
}
// Containment testing for arrays and strings that should be coherent with their iterator.
Array.prototype.contains = String.prototype.contains = function (e) {
@mkubenka
mkubenka / install.sh
Created April 23, 2016 19:28
OpenVPN Access Server Letsencrypt
#!/bin/sh
apt-get -y install git bc
git clone https://github.com/letsencrypt/letsencrypt /opt/letsencrypt
mkdir /etc/letsencrypt
@iacchus
iacchus / socket.io-1-0-apache-2.4-ssl.conf
Last active September 21, 2022 18:45
Set reverse proxy websockets in Apache 2.4 using socket.io 1.0. Needs mod_rewrite module, this version uses SSL. As seen here https://serverfault.com/questions/616370/configuring-apache-2-4-mod-proxy-wstunnel-for-socket-io-1-0
<VirtualHost *:80>
ServerName forum.example.com
Redirect permanent / https://forum.example.com
</VirtualHost>
<VirtualHost *:443>
ServerName forum.example.com
@TheCodeArtist
TheCodeArtist / git-prevision
Last active February 3, 2023 21:05
git checkout a previous revision of a specific file
Start by adding the following alias to your gitconfig.
[alias]
prevision = "!f() { git checkout `git log --oneline $2 | awk -v commit="$1" 'FNR == -commit+1 {print $1}'` $2;} ;f"
Usage:
$ git prevision <N> <filename>
will checkout the <N>th revision (counting backwards from HEAD) into the history of the file <filename>.
For example to checkout the immediate previous version of a file x/y/z.c use
@gregseth
gregseth / Qt4.natvis
Created July 24, 2014 09:27
Visual Studio 2012 debugger info for Qt 4.5+
<?xml version="1.0" encoding="utf-8"?>
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
<Type Name="QPoint">
<AlternativeType Name="QPointF"/>
<DisplayString>{{ x = {xp}, y = {yp} }}</DisplayString>
<Expand>
<Item Name="[x]">xp</Item>
<Item Name="[y]">yp</Item>
</Expand>
@jgamblin
jgamblin / instantkali.sh
Created March 5, 2018 00:39
Start an EC2 Kali Instance In Under 60 Seconds.
#!/bin/bash
set -e
set -u
clear
ami="ami-10e00b6d"
size="t2.medium"
today=$(date +"%m-%d-%y-%H%M")
localip=$(curl -s https://ipinfo.io/ip)
@naholyr
naholyr / _service.md
Created December 13, 2012 09:39
Sample /etc/init.d script

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)