Skip to content

Instantly share code, notes, and snippets.

View vinyll's full-sized avatar
🗺️
Creating locally

Vincent Agnano vinyll

🗺️
Creating locally
View GitHub Profile
@vinyll
vinyll / django-crossdomainxhr-middleware.py
Created March 15, 2012 09:01 — forked from vicalejuri/django-crossdomainxhr-middleware.py
Middlware to allow's your django server to respond appropriately to cross domain XHR (postMessage html5 API).
import re
from django.utils.text import compress_string
from django.utils.cache import patch_vary_headers
from django import http
from django.conf import settings
XS_SHARING_ALLOWED_ORIGINS = getattr(settings, 'XS_SHARING_ALLOWED_ORIGINS', '*')
@dongilbert
dongilbert / sms-alerts.php
Created April 18, 2012 14:15
Send SMS Alerts via PHP
<?php
// Get the POST data, if you are sending SMS as a response to a form.
$form = $_POST['form'];
// Insert your message here. Pull some results from $form or do whatever.
$message = 'Message Here.';
$subject = 'Whatever';
$to = array(
'Sprint' => 'phonenumber@messaging.sprintpcs.com',
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@davidbgk
davidbgk / empty-links.js
Created May 31, 2013 12:52
Formation CasperJS avec @n1k0 chez SFEIR le 31 mai 2013 pour scopyleft.
@don-smith
don-smith / meteor-dump.sh
Last active January 18, 2021 03:17 — forked from olizilla/meteor-dump.sh
A couple of shell scripts to dump and restore production Meteor (MongoDB) databases.
#!/bin/bash
# __
# _____ ____ _/ |_ ____ ____ _______
# / \ _/ __ \ \ __\_/ __ \ / _ \ \_ __ \
# | Y Y \\ ___/ | | \ ___/ ( <_> ) | | \/
# |__|_| / \___ > |__| \___ > \____/ |__|
# \/ \/ \/
#
# .___
# __| _/ __ __ _____ ______
@davidbgk
davidbgk / index.html
Created July 7, 2015 12:42
Current experimentations
<!doctype html>
<html lang=en>
<meta charset=utf-8>
<title>Current JS</title>
<style>
:root { --fontSize: 3rem; }
a { font-size: var(--fontSize); }
</style>
<a href=http://example.org>Link to example</a>
<a href=http://httpbin.org>Link to HTTPbin</a>
@yemster
yemster / adequate-template-engine.js
Last active January 28, 2021 21:17
Adequate template engine - Minimalist but entirely more than adequate Js templating engine
/*****************************************
* Usage:
* engine = Adqt.TemplateEngine
* template = 'My name is <% this.name %>'
* hash = { name: 'Yemi' }
*
* compiled = engine.compile(template) // => "var r=[]; r.push("My name is "); r.push( this.name ); return r.join("");"
* engine.render(compiled, hash) // => My name is Yemi
*
* engine.render(compiled, { name: 'Mike' }) // => My name is Mike
@Varriount
Varriount / aws_example.nim
Created September 21, 2017 22:38
Nim AWS Snippets
# AWS Version 4 signing example
# EC2 API (DescribeRegions)
# See: http://docs.aws.amazon.com/general/latest/gr/sigv4_signing.html
# This version makes a GET request and passes the signature
# in the Authorization header.
import base64, httpclient, hmac, nimSHA2, os, times, strutils, httpcore
# ************* REQUEST VALUES *************
@vinyll
vinyll / git-branch-sort.md
Last active July 26, 2021 07:07
Add the `git branch-sort` command to sort all branches by date.
git config --global alias.branch-sort "for-each-ref --sort=-committerdate refs/heads/ --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(color:red)%(objectname:short)%(color:reset) - %(contents:subject) - %(authorname) (%(color:green)%(committerdate:relative)%(color:reset))'"
@TRPB
TRPB / arch-macbook2018.md
Last active November 20, 2023 13:21
Guide: Running Arch on a 2018 MacBook Pro

Hardware Prerequisites

You'll need at least the following hardware:

  • At least 3 USB-A to USB-C converters or hub with enough ports for at least 3 USB devices if all your devices are USB-A then:
  • A USB drive
  • A USB keyboard
  • USB to Ethernet adapter, compatible USB dongle or USB tethering on a phone