Skip to content

Instantly share code, notes, and snippets.

@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
@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))
{
@twnaing
twnaing / Caddyfile
Created July 3, 2020 08:37
Caddyfile v2 for Ruby on Rails application
http://{$CADDY_HOST}:{$CADDY_PORT} {
root * ./public
@notStatic {
not {
file {
try_files {path}
}
}
}
@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" }
@twnaing
twnaing / cloudSettings
Last active August 31, 2021 09:12
Visual Studio Code Settings Sync Gist
{"lastUpload":"2021-08-31T09:12:11.160Z","extensionVersion":"v3.4.3"}
@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.

@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)
@chetan
chetan / db.rake
Last active July 12, 2022 19:18 — forked from e12e/db.rake
Rails rake tasks for dump & restore of PostgreSQL databases
# lib/tasks/db.rake
# Original source: https://gist.github.com/hopsoft/56ba6f55fe48ad7f8b90
# Merged with: https://gist.github.com/kofronpi/37130f5ed670465b1fe2d170f754f8c6
#
# This is the code from the comment:
# https://gist.github.com/hopsoft/56ba6f55fe48ad7f8b90#gistcomment-2275324
# Made into a fork/separate gist for easier download, with redundant shell-script removed.
#
#
# Usage:
@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
@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,