Skip to content

Instantly share code, notes, and snippets.

@jdan
jdan / wiki-scraper.rb
Created January 21, 2012 21:23
(Nokogiri) Tests the idea that the first link on each wikipedia article will eventually lead to philosophy
#!/usr/bin/env ruby
# wiki-scraper.rb by Jordan Scales
# http://jordanscales.com
# http://programthis.net
#
# Tests the idea that the first link on each wikipedia article
# will eventually lead to philosophy
#
# Usage:
@DragonBe
DragonBe / php_conferences_2016.md
Last active February 9, 2018 08:02
Overview of PHP oriented conferences in 2016 (excluding polyglot and framework oriented conferences)
@almost
almost / glacier.py
Created August 21, 2012 17:59
Amazon Glacier from Python. There's now a branch for this, see here: https://github.com/almost/boto/tree/glacier
# Thomas Parslow http://almostobsolete.net
# Just a work in progress and adapted to what I need right now.
# It does uploads (via a file-like object that you write to) and
# I've started on downloads. Needs the development version of Boto from Github.
#
# Example:
#
# glacierconn = GlacierConnection(AWS_ACCESS_KEY, AWS_SECRET_ACCESS_KEY)
# writer = GlacierWriter(glacierconn, GLACIER_VAULT)
# writer.write(somedata)
@j3tm0t0
j3tm0t0 / Upload2Glacier.ps1
Created August 21, 2012 09:11
Upload a file to Glacier PowerShell script version
Add-Type -Path "C:\Program Files (x86)\AWS SDK for .NET\bin\AWSSDK.dll"
$region="ap-northeast-1"
$accesskey="ACCESSKEY"
$secretkey="SECRETKEY"
$vaultname="myvault"
$description="some binary file"
$file="c:\hoge\target.bin"
$endpoint = [Amazon.RegionEndpoint]::GetBySystemName($region)
@oshliaer
oshliaer / 3acd892713c001e9a579.md
Last active December 27, 2019 03:30
Batch import CSV to a Spreadsheet #gas #sheet #csv
@Samuirai
Samuirai / captcha.md
Created June 14, 2012 20:59
G-WAN Captcha Decode

G-WAN is a new free web server. They seem to be very proud of it, or at least just want to make a lot of money. Well anyway, in almost every sentence they write, they claim that they are 20% cooler than anything else. It feels a bit arrogant. I have to admit, I don't know a lot about web servers, so I can't speak to how good they are.

However, then I saw their Captcha example. I also don't know much about machine learning algorithms, OCR, and stuff like that, but I do know how to read pixels. I also know how to compare values with python :P

demo

They say the following about their Captcha:

@ttscoff
ttscoff / rtftomarkdown.rb
Created October 9, 2012 21:05
Convert RTF/DOC files to Markdown via Textutil
#!/usr/bin/ruby
=begin
Usage: rtftomarkdown.rb FILENAME.rtf
Uses textutil, available on Mac only (installed by default)
Outputs to STDOUT
Notes:
Links are replaced with Markdown references (duplicate links combined).
@nikic
nikic / php_evaluation_order.md
Last active October 19, 2021 05:47
Analysis of some weird evaluation order in PHP

Order of evaluation in PHP

Yesterday I found some people on my [favorite reddit][lolphp] wonder about the output of the following code:

<?php

$a = 1;
$c = $a + $a++;
@bradmontgomery
bradmontgomery / count_words.py
Last active August 15, 2022 19:11
playing with python's `collections.Counter`
"""
Use a Counter to find the most common words in "The Wonderful Wizard of Oz" by
L. Frank Baum.
Available in (mostly) plain text at:
https://archive.org/stream/wonderfulwizardo00baumiala/wonderfulwizardo00baumiala_djvu.txt
Note: This code also counts the words in the header, so it's not a *realistic*
applicaton, but more of a demonstration of python's Counter.
@dbalatero
dbalatero / practice
Last active August 23, 2022 15:48
Records how long you practice something (guitar, language, etc) each day, and displays it.
#!/usr/bin/env ruby
class Practice
def initialize
@data = {}
try_to_load_data
end
def record_today(minutes)
@data[key_for(Time.now)] = minutes