This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
# Go to chrome tools -> bookmark manager -> organize -> export -> call it bookmarks.html | |
# Run this from the same directory as the export | |
File.open('bookmarks.html', 'r') do |f| | |
urls, dups = [], [] | |
domains = {} | |
while line = f.gets | |
url = line.match(/<A HREF="([^"]*)"/) | |
if url |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* This code is in public domain. Use for whatever purpose at your own risk. */ | |
#include <stdio.h> | |
#include <string.h> | |
#include <stdint.h> | |
#define MAXN 10000000000ll /* maximum value of N */ | |
#define P1 156250100ll /* = ceil(MAXN/64) */ | |
#define P2 5000000000ll /* = ceil(MAXN/2) */ | |
#define P3 50000ll /* = ceil(ceil(sqrt(MAXN))/2) */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
# remember to: | |
# sudo gem install pony | |
require 'rubygems' | |
require 'pony' | |
# -k Sender com.apple.backupd-auto | |
# This option specifies what recorded the log. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# maxs | |
# History | |
HISTFILE=~/.histfile | |
HISTSIZE=1000 | |
SAVEHIST=1000 | |
# task warrior | |
fpath=($fpath /usr/local/Cellar/task/1.9.4/share/doc/task/scripts/zsh) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
digraph models_diagram { | |
graph[overlap=false, splines=true] | |
"Venue" [shape=record, label="{\ | |
Venue|name :string\l\ | |
}"] | |
"User" [shape=record, label="{User|\ | |
email :string\l\ | |
password :string\l\ | |
}"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
raise "Usage: ruby main.rb ../java_program/src" unless ARGV[0] | |
java_files = Dir.glob(ARGV[0] + "/**/*.java") | |
@klasses = [] | |
java_files.each do |java_file| | |
@class_name = nil | |
@methods = [] | |
File.open(java_file).each_line do |line| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# email_stats.rb | |
# ======================`README.md`======================== | |
# | |
# Email Stats | |
# =========== | |
# | |
# Requirements | |
# ------------ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run this on dev machine, to download the .gem files to install. | |
# Spec the gems in the Gemfile and `bundle install` first. | |
task :bundle do | |
sh "bundle package" | |
end | |
# Run this on deploy location, to install and compile the | |
# .gem files with native extensions. | |
task :bundle_go do | |
sh "gem install --no-ri --no-rdoc --install-dir vendor/ vendor/cache/*.gem" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# gem install faraday nokogiri | |
require 'faraday' | |
require 'nokogiri' | |
START_PAGE = "/Articles/Classic-WTF-What-Is-Truth.aspx" | |
USERNAME = "INSTAPAPER USERNAME" | |
PASSWORD = "INSTAPAPER PASSWORD" | |
$conn = Faraday.new(:url => "https://www.instapaper.com") do |builder| | |
builder.request :url_encoded |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
:items: | |
- :name: Drink Grapefruit | |
:price: '4.59' | |
:owner: max | |
:paid: | |
:max: 0 | |
:ritwik: 314 |
OlderNewer