Skip to content

Instantly share code, notes, and snippets.

View darjeeling's full-sized avatar

Kwon-Han Bae darjeeling

  • LineCorp
  • Seoul, Korea
  • 01:52 (UTC +09:00)
View GitHub Profile
@dahlia
dahlia / gist:4407166
Created December 29, 2012 14:15
Jinja2 htmlfill ext
# htmlfill
with app.test_request_context('/'):
html = render_template_string('''
{%- autoescape true -%}
{%- form 'user.signup' with {'a': 123, 'b': 456} -%}
<input type="number" name="a"> {{- '' -}}
<input type="number" name="b" value="2"> {{- '' -}}
<input type="number" name="c" value="3">
{%- endform -%}
{%- endautoescape -%}
@khakimov
khakimov / gist:4029456
Created November 7, 2012 03:41
libevent http client
#include <sys/types.h>
#include <sys/time.h>
#include <sys/queue.h>
#include <stdlib.h>
#include <err.h>
#include <event.h>
#include <evhttp.h>
#include <unistd.h>
#include <stdio.h>
#include <sys/socket.h>
@luapz
luapz / backup.sh
Created August 12, 2012 15:08 — forked from comfuture/backup.sh
backup daily to remote host, and delete old backups smarter
#!/bin/bash
date=`date "+%Y-%m-%dT%H_%M_%S"`
HOME=/YOUR/LOCALHOME
SERVER=ID@HOST
DIR=backup
rsync -azP \
--bwlimit=500 \
--delete \
--delete-excluded \
@chaeplin
chaeplin / lgacir.ino
Last active September 8, 2015 16:04
lgacir.ino
https://github.com/z3t0/Arduino-IRremote/tree/master/examples/LGACSendDemo
@chaeplin
chaeplin / lgacir.py
Last active August 29, 2015 14:25
lgacir.py
# https://github.com/chaeplin/Arduino-IRremote/
# 02.test_i2c.py
import smbus
import time
bus = smbus.SMBus(1)
address = 0x07
def writeNumber(a, b ):