Skip to content

Instantly share code, notes, and snippets.

@bouroo
bouroo / softether.sh
Last active April 14, 2023 21:12
Install softether vpn server on ubuntu 16.04+
#!/usr/local/env bash
# Register vultr.com with free credit https://www.vultr.com/?ref=9206731-8H
# Create vps
# Tested on Ubuntu 18.04, Debian 10.0
# How to...
# 1. Save this file as softether-installer.sh
# 2. chmod +x softether-installer.sh
# 3. Run bash file
# > ./softether-installer.sh
# Or just
@jackrg
jackrg / active_record.rb
Created May 16, 2014 18:14
Add bulk import functionality to Rails Active Record (add this file to config/initializers, call <model>.import!(array-of-record-hashes))
class ActiveRecord::Base
def self.import!(record_list)
raise ArgumentError "record_list not an Array of Hashes" unless record_list.is_a?(Array) && record_list.all? {|rec| rec.is_a? Hash }
return record_list if record_list.empty?
(1..record_list.count).step(1000).each do |start|
key_list, value_list = convert_record_list(record_list[start-1..start+999])
sql = "INSERT INTO #{self.table_name} (#{key_list.join(", ")}) VALUES #{value_list.map {|rec| "(#{rec.join(", ")})" }.join(" ,")}"
self.connection.insert_sql(sql)
@killwing
killwing / slideshare-downloader.sh
Last active December 15, 2015 04:38 — forked from giudinvx/slideshare-downloader.sh
[slideshare-downloader] This script takes a slideshare presentation URL as an argument and carves all the slides in flash format, then they are converted to and finally merged as a PDF.
#!/bin/bash
# Author: Andrea Lazzarotto
# http://andrealazzarotto.com
# andrea.lazzarotto@gmail.com
# Slideshare Downloader
# This script takes a slideshare presentation URL as an argument and
# carves all the slides in flash format, then they are converted to
# and finally merged as a PDF
@mikedfunk
mikedfunk / README.md
Created August 28, 2012 21:17
CodeIgniter Pagination for Twitter Bootstrap

This uses Twitter Bootstrap classes for CodeIgniter pagination.

Drop this file into application/config.

@twnaing
twnaing / iDeviceSafariDelicious
Created March 23, 2012 05:50
Bookmarklet code to add delicious bookmark in iPad
javascript:(
function(){
f=’http://delicious.com/save?url=’+encodeURIComponent(window.location.href)+’&title=’+encodeURIComponent(document.title)+’&v=5&’;
a=function()
{
if(!window.open(f+’jump=doclose’,'deliciousuiv5′,’location=yes,links=no,scrollbars=no,toolbar=no,width=550,height=550′))
location.href=f+’jump=yes’
};
if(/Firefox/.test(navigator.userAgent))
{
@robcowie
robcowie / Preferences.sublime-settings
Created March 16, 2012 12:36
Example Sublimetext 2 TODO plugin config
{
"color_scheme": "Packages/User/textmate-solarized/Solarized (Dark).tmTheme",
"default_line_ending": "unix",
"dictionary": "Packages/Language - English/en_GB.dic",
"draw_white_space": "selection",
"find_selected_text": true,
"font_face": "menlo",
"font_size": 12,
"highlight_line": true,
@fnhipster
fnhipster / html5.haml
Created April 9, 2011 01:19
HTML5 HAML Template
!!! 5
%html
%head
%title= "Your Website"
%meta{ :content => "", :name => "description" }
%meta{ :content => "", :name => "author" }
%meta{ :content => "3 days", :name => "revisit-after" }
%link{ :href => "http://creativecommons.org/licenses/by/3.0/", :rel => "license", :title => "Creative Commons Attribution 3.0 Unported License" }
%link{ :href => "/feed", :rel => "alternate", :title => "Atom", :type => "application/atom+xml" }
%link{ :href => "/css/screen.css", :media => "screen", :rel => "stylesheet" }
I am the owner of lvh.me. And I'm glad to hear it's helpful. In truth, it's just a fancy DNS trick. lhv.me and all of it's sub-domains just point back to your computer (127.0.0.1). That means running ssl is as simple (or difficult) as running ssl on your computer.
I'm not sure how comfortable you are with the command line, but here's my how I setup my development environment. (rvm, passenger, nginx w/ SSL, etc).
# Install rvm (no sudo!)
# ------------------------------------------------------
bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )
source ~/.rvm/scripts/rvm
rvm install ree-1.8.7-2010.02