Skip to content

Instantly share code, notes, and snippets.

@quilime
quilime / DARK.dvtcolortheme
Created Jan 22, 2015
monochrome xcode theme
View DARK.dvtcolortheme
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>DVTConsoleDebuggerInputTextColor</key>
<string>0 0 0 1</string>
<key>DVTConsoleDebuggerInputTextFont</key>
<string>Menlo-Bold - 11.0</string>
<key>DVTConsoleDebuggerOutputTextColor</key>
<string>0 0 0 1</string>
View get_patches.php
<?php
function get_patches($dir){
global $c, $inc, $offset_left, $offset_top;
$dir_array = [];
$inc = 0;
$path = realpath($dir);
//$dirs = new RecursiveDirectoryIterator($path, FilesystemIterator::SKIP_DOTS);
$dirs = new RecursiveDirectoryIterator($path, RecursiveDirectoryIterator::SKIP_DOTS);
View get_patches.php
<?php
function get_patches($dir) {
global $c, $inc, $offset_left, $offset_top;
$inc = 0;
$dir_array = [];
$path = realpath($dir);
View gist:3fc0cbd4a663d09c07ed
<?php
class MyRecursiveFilterIterator extends RecursiveFilterIterator {
public function accept() {
return
$this->current()->isDir() &&
strpos($this->current()->getFilename(), '.') === false;
}
}
View index.html
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
font: 10px sans-serif;
shape-rendering: crispEdges;
}
.day {
View index.html
<!DOCTYPE html>
<meta charset="utf-8">
Hello, world!!!
@quilime
quilime / triangle.frag
Last active Dec 22, 2015
GLSL Triangle function
View triangle.frag
// via "Einstienstien" - by Dave Hoskins, on Shadertoy
// http://glsl.heroku.com/e#10662.0
#ifdef GL_ES
precision mediump float;
#endif
uniform vec2 resolution;
float col = 0.0; // Start black.
@quilime
quilime / htmlwordcount.py
Last active Dec 16, 2015
Count words from html
View htmlwordcount.py
import nltk
import string
from urllib import urlopen
from itertools import imap
url = "http://google.com"
html = urlopen(url).read()
text = nltk.clean_html(html)
text_noPunc = text.translate(string.maketrans("",""), string.punctuation)
words = text_noPunc.split()
@quilime
quilime / stars.py
Created Apr 18, 2013
random stars in the console
View stars.py
#!/usr/bin/python
import random
rows = 20
cols = 80
num_stars = 100
rand_stars = []
while (len(rand_stars) < num_stars):