Skip to content

Instantly share code, notes, and snippets.

View joelrebel's full-sized avatar

Joel Rebello joelrebel

View GitHub Profile
@joelrebel
joelrebel / gist:6271290
Last active December 21, 2015 07:29
Git -> s3 script
#!/usr/bin/python
#Script to sync git repo with s3, only changed files are uploaded
#Depends on the s3cmd utility, runs git diff ONLY with the previous repo HEAD.
#Include script into the git repo root directory, ensure it is executable
#
#To add a convienient alias defined the below in .git/config
#[alias]
#push-s3 = "!$(pwd)/s3-sync.py"
#push-both = "!git push && git push-s3"
#
#A mysql host/group should define either the 'percona_mysql' or 'vanilla_mysql' to true,
#this tells the play which mysql variant should be installed.
---
#apt_expects the exact url to the key, the url can be found by searching for the id at http://keyserver.ubuntu.com/
- name: add_percona_aptkeys
action: apt_key data="{{ lookup('file', '../files/percona.gpg') }}" ## id=1C4CBDCDCD2EFD2A url="http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x1C4CBDCDCD2EFD2A" state=present ## apt_key module needs fixing to look up keys.
when: percona_mysql is defined
tags:
- mysql
- add_percona_aptkeys
pname=window.location.hostname;c=document.getElementById('padtable');items=c.getElementsByTagName('a');for (i=2;i<items.length;i++){s=items[i].toString().split(/\//).pop(); url='http://' + pname +'/ep/pad/export/' + s + '/latest?format=txt';document.write('<a href='+ url +'>'+url+'</a><br/>');}
--- a/functions.h 2014-10-17 13:54:38.436185512 +0800
+++ b/functions.h 2014-10-17 13:57:38.742969851 +0800
@@ -150,6 +150,7 @@
{ "clear-flag", OP_MAIN_CLEAR_FLAG, "W" },
{ "display-message", OP_DISPLAY_MESSAGE, M_ENTER_S },
{ "buffy-list", OP_BUFFY_LIST, "." },
+ { "buffy-refresh", OP_BUFFY_REFRESH, "`"},
{ "sync-mailbox", OP_MAIN_SYNC_FOLDER, "$" },
{ "display-address", OP_DISPLAY_ADDRESS, "@" },
{ "pipe-message", OP_PIPE, "|" },
sub find_prereqs {
my($self, $dist) = @_;
my @deps = $self->extract_meta_prereqs($dist);
if ($dist->{module} =~ /^Bundle::/i) {
push @deps, $self->bundle_deps($dist);
}
if ($self->{cpanfile_requirements} && !$dist->{cpanfile}) {
$ cat /tmp/j.java
@Override
protected Integer doInBackground(byte[]...arr) {
byte[] fft = arr[0];
int[] bands = new int[50];
int[] mag = new int[100];
def iter_fetch(l=[], c=5):
'''
given a list, yield c number
of items at a time.
'''
end=0
start=0
while True:
if (end + c) >= len(l)-1:
#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>
const char* ssid = "fridge";
const char* password = "fridge";
ESP8266WebServer server(80);
void handle_root() {
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
SleekXMPP: The Sleek XMPP Library
Copyright (C) 2010 Nathanael C. Fritz
This file is part of SleekXMPP.
See the file LICENSE for copying permission.
"""
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
SleekXMPP: The Sleek XMPP Library
Copyright (C) 2010 Nathanael C. Fritz
This file is part of SleekXMPP.
See the file LICENSE for copying permission.
"""