Skip to content

Instantly share code, notes, and snippets.

View sandeepone's full-sized avatar
💭
I may be slow to respond.

Sandeep sandeepone

💭
I may be slow to respond.
View GitHub Profile
@sandeepone
sandeepone / main.go
Last active August 29, 2015 14:24 — forked from segphault/main.go
package main
import (
"code.google.com/p/gcfg"
"fmt"
r "github.com/dancannon/gorethink"
irc "github.com/fluffle/goirc/client"
"log"
"strings"
)
// FIXME: use %PROGRAMFILES% to get at "c:\\Program\ Files"
// FIXME: put SAVE_DIR on the current user's desktop?
// FIXME: make it configurable via command-line options?
var BROWSERS = {
'ff' : {
'PATH' : "c:\\Program\ Files\\Mozilla\ Firefox\\",
'SAVE_DIR' : ".\\firefox\\"
},
'ie' : {
'PATH' : "",
@sandeepone
sandeepone / db.php
Last active August 29, 2015 14:20 — forked from skowron-line/db.php
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
*
* @author skowron-line
*/
class DB extends Kohana_DB {
public static $_cache_driver = 'file';
public static $_log_query = false;
private static $_transaction = false;
#!/bin/bash
MAJOR_VERSION=$1
MINOR_VERSION=$2
if [ $# -lt 2 ]
then
echo "Usage: $0 <MAJOR-VERSION> <MINOR-VERSION>"
exit
fi
upstream myapp {
server 127.0.0.1:8081;
}
limit_req_zone $binary_remote_addr zone=login:10m rate=1r/s;
server {
listen 443 ssl spdy;
server_name _;
#
# Slightly tighter CORS config for nginx
#
# A modification of https://gist.github.com/1064640/ to include a white-list of URLs
#
# Despite the W3C guidance suggesting that a list of origins can be passed as part of
# Access-Control-Allow-Origin headers, several browsers (well, at least Firefox)
# don't seem to play nicely with this.
#
local jid_bare = require "util.jid".bare;
local os_time = os.time;
local t_concat = table.concat;
local smtp = require "socket.smtp";
local vcards = module:open_store("vcard");
local smtp_server = module:get_option_string("smtp_server", "localhost");
local smtp_user = module:get_option_string("smtp_username");
local smtp_pass = module:get_option_string("smtp_password");
local smtp_daemon = module:get_option_string("smtp_daemon");
@sandeepone
sandeepone / README.md
Last active August 29, 2015 14:16 — forked from LeoColomb/README.md

JankyBrowser

The only cross-platform browser that fits in a Gist!

One line install. Works on Linux, MacOSX and Windows.

Local Install

$&gt; npm install http://gist.github.com/morganrallen/f07f59802884bcdcad4a/download
func EncodeStreamingVideo(streamingFile io.Reader, request ShouldCanceler) (*os.File, error) {
outputFilename := generateFilename("mp4")
// Actually start the command.
cmd := exec.Command("ffmpeg",
// Read input from stdin.
"-i", "-",
// ... environment-specific ffmpeg options ...
"-y", outputFilename)
@sandeepone
sandeepone / Encbox.md
Last active August 29, 2015 14:12 — forked from Tho85/Encbox.md

Build your own private, encrypted, open-source Dropbox-esque sync folder

Prerequisites:

  • One or more clients running a UNIX-like OS. Examples are given for Ubuntu 12.04 LTS, although all software components are available for other platforms as well (e.g. OS X). YMMV
  • A cheap Ubuntu 12.04 VPS with storage. I recommend Backupsy, they offer 250GB storage for $5/month. Ask Google for coupon codes.

Software components used:

  • Unison for file synchronization
  • EncFS for folder encryption