Skip to content

Instantly share code, notes, and snippets.

@aanoaa
aanoaa / a.md
Created November 30, 2011 14:41

숨겨진 text

perl code를 실행할 수 있다면 소스코드를 볼 수도 있습니다. 하지만 몇 줄 안되는 코드로 자신의 코드를 숨길 수도 있습니다.

어떻게?

@asergeyev
asergeyev / anyevent.html
Created January 9, 2012 16:58
Anyevent example for websockets to support old websocket proto from some agents (Safari, Chrome on Google TV)
<!DOCTYPE html>
<!-- mostly borrowed from Mojo -->
<html>
<head>
<title>WebSocket</title>
</head>
<body>
Testing WebSockets, please make sure you have JavaScript enabled.

Sass/Less Comparison

In this document I am using Sass's SCSS syntax. You can choose to use the indented syntax in sass, if you prefer it, it has no functional differences from the SCSS syntax.

For Less, I'm using the JavaScript version because this is what they suggest on the website. The ruby version may be different.

Variables

@joergschiller
joergschiller / a2dp_sink_ubuntu_linux.md
Created January 24, 2012 23:05
A2DP Sink on Ubuntu Linux with bluez (streaming bluetooth stereo audio from smartphone to pc)

Howto Enable and Use A2DP Sink on Ubuntu Linux with Bluez

  1. Add Enable=Source to /etc/bluetooth/audio.conf right after [General].

  2. Find address in form XX:XX:XX:XX:XX:XX of phone with hcitool scan.

  3. Pair and trust smartphone with sudo bluez-simple-agent hci0 XX:XX:XX:XX:XX:XX and sudo bluez-test-device trusted XX:XX:XX:XX:XX:XX yes.

  4. Create loopback in pulseaudio connection bluetooth a2dp source with alsa sink:

#!/usr/bin/perl
#===============================================================================
#
# FILE: intime.pl
#
# USAGE: ./intime.pl
#
# DESCRIPTION:
#
# OPTIONS: ---
@ainvyu
ainvyu / gist:1882996
Created February 22, 2012 07:21
perlbrew
PERLBREW_PERL="perl-5.14.2"
10 0 * * * envi PATH="$HOME/perl5/perlbrew/perls/$PERLBREW_PERL/bin:$PATH" /usr/bin/env perl /some/script_path
@miyagawa
miyagawa / gist:1912431
Created February 26, 2012 02:53
How to represent Links in REST

How to embed HATEOAS/Link inside JSON

HTTP Headers

For HTTP headers it's quite straightforward: draft-nottingham-http-link-header defines this.

Link: <http://example.com/>; rel="previous"; titile="Previous chapter"

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@olegwtf
olegwtf / json_ordered.pl
Created March 26, 2012 04:39
Save JSON object keys ordering as is
use strict;
use Tie::IxHash;
use JSON::PP;
# magic start
my $obj_parser_sub = \&JSON::PP::object;
*JSON::PP::object = sub {
tie my %obj, 'Tie::IxHash';
$obj_parser_sub->(\%obj);
@taterbase
taterbase / upload.php
Created May 13, 2012 15:03
Simple file upload in php
<!DOCTYPE html>
<html>
<head>
<title>Upload your files</title>
</head>
<body>
<form enctype="multipart/form-data" action="upload.php" method="POST">
<p>Upload your file</p>
<input type="file" name="uploaded_file"></input><br />
<input type="submit" value="Upload"></input>