Skip to content

Instantly share code, notes, and snippets.

@premist
premist / tomorrow-night-eighties.js
Created October 8, 2013 06:56
Tomorrow Night Eighties colorset on Chrome Secure Shell
term_.prefs_.set('cursor-blink', true);
term_.prefs_.set('background-color', '#2d2d2d');
term_.prefs_.set('foreground-color', '#cccccc');
term_.prefs_.set('cursor-color', '#515151');
term_.prefs_.set('color-palette-overrides', [
'#515151',
'#f2777a',
'#99cc99',
'#ffcc66',
@premist
premist / downmark_it.rb
Created July 7, 2013 06:53
WordPress to Jekyll
# =Overview
# DownmarkIt is a library to convert HTML to markdown, based on Hpricot[http://github.com/hpricot/hpricot/].
#
# =Motivation
# While working on our company's new CMS, I needed to parse HTML back to markdown and surprisngly there wasn't any solution that could fit our enviroment, so I decided to make my own and share it :)
#
# =Usage
# Make sure you install Hpricot[http://github.com/hpricot/hpricot/] first, then require the library in your application, if you are using the library in a rails application, just place it in your lib folder, then use this method to convert HTML into markdown.
# markdown = DownmarkIt.to_markdown(html)
#
@premist
premist / cgminer.rb
Last active August 13, 2021 01:29
Install cgminer on Mac OS X using homebrew
require 'formula'
# Original : https://raw.github.com/Kaelten/homebrew/master/Library/Formula/cgminer.rb
class Cgminer < Formula
homepage 'https://github.com/ckolivas/cgminer'
url 'https://github.com/ckolivas/cgminer/archive/v2.10.4.zip'
sha1 'cf592852b913749378db7f43a561b90c2b6448be'
depends_on 'automake' => :build
@premist
premist / autodeploy.rb
Created December 10, 2012 17:03
Dead simple auto-deploy script for REMU
require 'sinatra'
require 'json'
post '/' do
puts "Something is coming..."
if(!params[:payload])
return "Not Github request - ignoring"
puts "Someone is bothering me."
end
@premist
premist / readFileCache.js
Created September 7, 2012 08:38
readFileCache.js: fs.readFile LRU(Least Recently Used) Cache for Node.js
// readFileCache.js
// fs.readFile LRU(Least Recently Used) Cache for Node.js
// This module will cache file data automatically on memory
// in order to serve the data faster for repetitive requests.
// Usage:
// var cache = require('./readFileCache.js');
// cache.readFile('./index.html', 'utf-8', function(err, data) {
// response.write(data);
@premist
premist / gist:3235577
Created August 2, 2012 08:56 — forked from danparsons/gist:3195652
How to stream the London 2012 Olympics

How to stream the London 2012 Olympics

There have been several HOWTOs posted regarding streaming the 2012 Olympics using HTTP / SOCKS proxies via SSH and other similar methods. None of these actually work using the latest Flash on Mountain Lion (with Firefox, Chrome or Safari). Additionally, the third-party streaming sites don't provide BBC's amazing interface, which lets you quickly skip to individual competitors and events. However, setting up an OpenVPN server does work, with some tweaks. You'll get the exact same UX that people in England receive.

@premist
premist / nodeserv
Created June 18, 2012 12:49
NodeServ + forever init.d script
#! /bin/bash -e
set -e
PATH=/usr/bin
DAEMON=/opt/NodeServ/server.js
case "$1" in
start) forever start $DAEMON ;;
stop) forever stop $DAEMON ;;
force-reload|restart)
forever restart $DAEMON ;;
*) echo "Usage: /etc/init.d/nodeserv {start|stop|restart|force-reload}"
@premist
premist / wp-config.php
Created May 25, 2012 08:51
Enable WordPress's direct core update or plugin/theme install
<?php
/* After "that's all, stop editing! Happy blogging.", put these lines.
Change permission value(default is 0755) if you want. */
if(is_admin()) {
add_filter('filesystem_method', create_function('$a', 'return "direct";' ));
define( 'FS_CHMOD_DIR', 0755 );
}
@premist
premist / service
Created April 20, 2012 02:34 — forked from bmeck/service
init.d script
#!/bin/bash
#
# initd-example Node init.d
#
# chkconfig: 345 80 20
# description: Node init.d example
# processname: node
# pidfile: /var/run/initd-example.pid
# logfile: /var/log/initd-example.log
#
@premist
premist / debug.css
Created April 8, 2012 14:02
Javascript-less DOM Debugger for HTML5
div, span, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
abbr, address, cite, code,
del, dfn, em, img, ins, kbd, q, samp,
small, strong, sub, sup, var,
b, i,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, figcaption, figure,