Skip to content

Instantly share code, notes, and snippets.

View ryanseys's full-sized avatar
🌴

Ryan Seys ryanseys

🌴
View GitHub Profile
@jedp
jedp / gist:4062623
Last active October 12, 2015 17:37
try server and mercurial queues
# push to try
hg qref --message "try: -b do -p all -u all -t none"
hg push -f try
# refresh with name and bug info
hg phase -f --draft qbase:tip # if it complains about immutable revisions
hg qrefresh -m "Bug 876543 - blah blah blah. r=pqdbach"
@Barnabas
Barnabas / auth.jade
Last active December 10, 2015 05:18
Persona Express AngularJS module
html(ng-app="persona")
body(ng-controller="PersonaCtrl")
div(ng-hide="verified")
button(ng-click="verify()") Verify Identity
div(ng-show="verified")
| Hello {{email}}
br
button(ng-click="logout()") Log Out
div(ng-show="error")
strong {{error}}
@shuhaowu
shuhaowu / mergerange.py
Last active December 15, 2015 12:09
Consider this public domain. This takes a sorted number range and merges the overlapping ones. If you just have a bunch of number ranges, you could always sort and then pass it in to this.
def merge_range_sorted(r):
"""Merges and sorts a range of numbers. Used for block merging.
Worse-case runtime:
O(n)
Args:
r: A **sorted**, from low to high, list of ranges in a tuple format.
Returns:
@christianberg
christianberg / bootstrap.sh
Last active April 1, 2016 12:20
Script to install Docker on a Ubuntu 13.04 host
#/bin/bash
set -e
echo "=== Activating Firewall (only SSH allowed) ==="
ufw allow ssh
ufw --force enable
if [ ! -f /swapfile ]; then
echo "=== Activating swap ==="
fallocate -l 1G /swapfile
@idan
idan / gist:3135754
Created July 18, 2012 11:50
A Sample Post

Hello there! This is a sample post for gist.io, a super-lightweight writing soapbox for hackers.

Now look up. Further. Above the post title. See that grey text with the gist ID?

Now back to me. That grey text is a link! Open that sucker in a new tab to see the source for this post. Also, I'm on a horse.

This is a major heading

If you peek at it with a web inspector, you'll see that it is a second-level heading. You can use first level headings, but they'll look just like the second level ones, and the gods of the HTML5 outlining algorithm will frown upon you.

@vnu
vnu / gist:3258553
Created August 4, 2012 16:07
Android dumpsys denial to access programmatically

How to log the dumpsys information periodically?

What is dumpsys and what are its benefits?

Dumpsys is a very interesting android shell command that dumps the state of various running services and also other system information on std output.

Benefits :

Retrieve various system information in a simple string representation Analyse the various stats like cpuinfo, batteryinfo, meminfo, wifi, location etc., to analyze the overall performance of the device and also the individual performance of various application and services.

@X0nic
X0nic / disable-vagrant-time-sync.sh
Last active February 4, 2022 04:52
Disable vagrant time sync
#List vms
VBoxManage list vms
#get status of time sync
VBoxManage getextradata <vm-name> VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled
#NOTE: Make sure to restart the VM after changing these settings.
#disable time sync
VBoxManage setextradata <vm-name> VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled 1
Hi David,
I came across your profile online and wanted to reach out about Development
Opportunities here at Groupon. The company is growing, and we're always
looking for folks with solid skills that can make positive contribution to
our continued success. Any chance you'd be open to a quick conversation
about opportunities, or for any possible networking potential? If so, let me
know when you're free and we can set up a time to chat. Also, if you are
interested, it would be great if you could forward a current resume over
that I can take a look at. I look forward to hearing back from you! Please
let me know if you have any questions.
@rickharrison
rickharrison / jekyll.nginxconf
Created September 2, 2013 07:41
Nginx server config with clean URLs for Jekyll.
server {
listen 80;
server_name www.yourdomain.com;
return 301 $scheme://yourdomain.com$request_uri;
}
server {
listen 80;
root /var/www/yourdomain.com;
@ShirtlessKirk
ShirtlessKirk / luhn.js
Last active February 12, 2024 05:09
Luhn validation algorithm
/**
* Luhn algorithm in JavaScript: validate credit card number supplied as string of numbers
* @author ShirtlessKirk. Copyright (c) 2012.
* @license WTFPL (http://www.wtfpl.net/txt/copying)
*/
var luhnChk = (function (arr) {
return function (ccNum) {
var
len = ccNum.length,
bit = 1,