Skip to content

Instantly share code, notes, and snippets.

View itsbth's full-sized avatar

Bjørn Tore Håvie itsbth

View GitHub Profile
@itsbth
itsbth / defaced.html
Created November 21, 2011 19:43
Uploaded by UploadToGist for Sublime Text 2
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="generator" content=
"HTML Tidy for Linux/x86 (vers 11 February 2007), see www.w3.org" />
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
<title>xHTMLx Has Defaced</title>
<meta content="MSHTML 6.00.2900.2180" name="GENERATOR" />
<style type="text/css">
/*<![CDATA[*/
@itsbth
itsbth / CodePacker.php
Created December 1, 2011 13:02
Uploaded by UploadToGist for Sublime Text 2
<?php
namespace PHPacker
{
class CodePacker
{
private $file;
private $parser;
private $stmnts;
public static $SUPERGLOBALS = array('GLOBALS', '_SERVER', '_GET', '_POST', '_FILES', '_COOKIE', '_SESSION', '_REQUEST', '_ENV');
using System;
unsafe class Unsafe
{
public static unsafe string DoStuff()
{
string st = "-0.5";
fixed (char *str = st)
return new String(str + 1);
}
@itsbth
itsbth / room.coffee
Created December 11, 2011 03:30
Uploaded by UploadToGist for Sublime Text 2
class Room
constructor: (@name) ->
owner: (cb) ->
R.get "rooms:#{@name}:owner", (err, owner) ->
cb owner
members: (cb) ->
R.smembers "rooms:#{@name}:members", (err, members) ->
cb members
ActionScript
AppleScript
ASP
Batch File
C#
C++
Clojure
coffee-script-tmbundle
Color Scheme - Default
CSS
@itsbth
itsbth / room.coffee
Created December 14, 2011 18:31
Uploaded by UploadToGist for Sublime Text 2
class Room
constructor: (@name) ->
owner: (cb) ->
R.get "rooms:#{@name}:owner", (err, owner) ->
cb owner
members: (cb) ->
R.smembers "rooms:#{@name}:members", (err, members) ->
cb members
@itsbth
itsbth / _nav.html.haml
Created December 16, 2011 20:17
Uploaded by UploadToGist for Sublime Text 2
.topbar-wrapper{:style => "z-index: 5;"}
.topbar{"data-dropdown" => "dropdown"}
.topbar-inner
.container
%h3#branding
%a{:href => "/"} DupeShare
%ul.nav
%li.active
%a{:href => "#"} Home
%li
@itsbth
itsbth / application.html.haml
Created December 17, 2011 21:03
Uploaded by UploadToGist for Sublime Text 2
!!!
%html
%head
%title DupeShare
= stylesheet_link_tag "application"
= javascript_include_tag "application"
= csrf_meta_tags
:javascript
setTimeout(function () {
window.location.reload();
@itsbth
itsbth / grabify
Created December 22, 2011 09:25
Uploaded by UploadToGist for Sublime Text 2
#!/bin/bash
SIZE="1280x720"
THUMB="512x512"
OUT="mc.itsbth.com:/var/www/img/w/"
WEB="http://img.itsbth.com/w/"
TITLE=$(curl "$1" 2> /dev/null | perl -ne '$_ =~ m#<title>(.+)</title># and print $1')
TITLE=$(perl -e '$ARGV[0] =~ s/[^A-Za-z0-9]+/-/g; print $ARGV[0]' "$TITLE")
FILENAME="${TITLE}_$(date '+%d-%m-%y_%H-%M-%S')"
local function map(f, iter, state, k)
return function(state, k)
local v
k, v = iter(state, k)
if k then
return k, f(v)
end
end, state, k
end