Skip to content

Instantly share code, notes, and snippets.

var config = require('../config');
var nickcolor = require('./nickcolor');
var nodeStatic = require('node-static');
var fs = require('fs');
var path = require('path');
var osHomedir = require('os-homedir');
var mkdirp = require('mkdirp');
var crypto = require('crypto');
var logger = require('winston');
var imgur = require('imgur');
@davesherratt
davesherratt / DefaultLayout.jsx
Created January 26, 2016 21:02 — forked from koistya/DefaultLayout.jsx
React.js (ReactJS) Page and Layout components. For a complete sample visit https://github.com/kriasoft/react-starter-kit and http://reactjs.kriasoft.com (demo)
/**
* Page layout, reused across multiple Page components
* @jsx React.DOM
*/
var React = require('react');
var ExecutionEnvironment = require('react/lib/ExecutionEnvironment');
var Navigation = require('../components/Navigation.jsx');
var DefaultLayout = React.createClass({
### Keybase proof
I hereby claim:
* I am davesherratt on github.
* I am davesherratt (https://keybase.io/davesherratt) on keybase.
* I have a public key whose fingerprint is 7C8D 3BC8 F366 AB9E 20DD 7960 8389 BAA6 9DD4 2B05
To claim this, I am signing this object:
#!/bin/sh
SCP_USER='user'
SCP_HOST='host'
SCP_PASS='pass'
SCP_PATH='/path/to/file'
HTTP_URL="http://url"
FILENAME=`(cat /dev/random|head -c 10; date) | md5 -q | head -c 10`.png
This file has been truncated, but you can view the full file.
'use strict';
var COMPILED = !0, goog = goog || {};
goog.global = this;
goog.DEBUG = !1;
goog.LOCALE = "en";
goog.provide = function (a) {
if (!COMPILED) {
if (goog.isProvided_(a))
throw Error('Namespace "' + a + '" already declared.');
set var %a
on *:text:!ring *:#: {
if ( $nick ison #fang.priv) { %a = $2- }
if (+* iswm %a) { /ring %a }
else { /msg #fang.priv 9looking up number for %a
/msg angelica .phone show %a }
}
on *:TEXT:*valid*:?: {
class PromotionsController < ApplicationController
require 'barby/barcode/ean_8'
require 'barby/barcode/ean_13'
require 'csv'
require 'nokogiri'
require 'cgi'
require 'json'
require 'builder/xchar'
def upload
ajax_upload = params[:qqfile].is_a?(String) # either a file name (set) or a file (NOT SET, but qqFileUploader allows for it)
filename = ajax_upload ? params[:qqfile] : params[:qqfile].original_filename
if ajax_upload
csv_source = request.body.read
else
csv_source = params[:qqfile].read
end
tmp_file = "#{Rails.root}/data/tmp-#{cookies[:remember_token]}.csv"
csv_valid = false
@davesherratt
davesherratt / gist:3799434
Created September 28, 2012 12:07
Centos 6.3 - Nginx ruby 1.9.3 rails unicorn
yum -y update
yum -y install emacs readline-devel ncurses-devel libevent-devel glib2-devel libjpeg-devel freetype-devel bzip2 bzip2-devel bzip2-libs openssl-devel pcre pcre-devel gpg make gcc yum-utils unzip
yum grouplist |grep -i Development
rpm -ihv http://centos.alt.ru/repository/centos/6/x86_64/centalt-release-6-1.noarch.rpm
rpm -Uvh http://mirrors.ukfast.co.uk/sites/dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-7.noarch.rpm
@davesherratt
davesherratt / etc_init.d_unicorn_example.co.uk
Created September 2, 2012 21:13 — forked from rubysolo/etc_init.d_unicorn_example.co.uk
Ruby on Rails server setup on Ubuntu 11.04 with Nginx, Unicorn, Rbenv
#! /bin/bash
### BEGIN INIT INFO
# Provides: unicorn
# Required-Start: $local_fs $remote_fs $network $syslog
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the unicorn web server
# Description: starts unicorn