Skip to content

Instantly share code, notes, and snippets.

View kost's full-sized avatar
💭
I'm upto something

kost kost

💭
I'm upto something
  • Diverto
  • Zagreb, Croatia
  • X @k0st
View GitHub Profile
anonymous
anonymous / index.html
Created August 23, 2012 10:21
A little canvas + javascript experiment - using concentric shapes to draw images/patterns... experiment with controls at: http://tholman.com/experiments/html5/concentrics
<canvas id='canvas'></canvas>
<!--
Concentrics: A little Canvas + Javascript experiment by @twholman
Experiment + controls @ http://tholman.com/experiments/html5/concentrics
-->
@etewiah
etewiah / My aliases.txt
Created August 23, 2012 10:42
My aliases
alias dbreset='rake db:drop; rake db:create; rake db:migrate; rake db:seed; rake db:test:prepare'
alias dbupdate='rake db:migrate; rake db:seed; rake db:test:prepare'
alias gcall='git add .; git commit -am'
@dansondergaard
dansondergaard / js-is-fucked.js
Created August 23, 2012 10:56
JavaScript is fucked
function hello() {
return {
a: 2
};
}
function hello2() {
return
{
a: 2
@tomviner
tomviner / pretty.py
Last active November 29, 2021 12:42
Parse ps output to show top CPU, memory and process count, summed over identically named processes
import string
def pretty_size(size):
"size in bytes"
size = int(size)
units = ' KMGTPE'+string.lowercase[::-1]
bytes = 'B'
i = 0
while size>1024:
@chattama
chattama / gist:3443835
Created August 24, 2012 00:11
raspberry pi cross compile (kernel build)
cd ~/raspi
git clone https://github.com/raspberrypi/linux.git
wget http://xecdesign.com/downloads/linux-qemu/linux-arm.patch
patch -p1 -d linux/ < linux-arm.patch
cd ~/raspi/linux
make ARCH=arm versatile_defconfig
@ptweir
ptweir / serialLEDControl.ino
Last active October 9, 2015 05:18
Arduino code to control the intensity of an LED
// control intensity of LED using serial communication
int incomingByte = 0; // for incoming serial data
int outVal = 0; // for signal out
int pwmPin = 6; // white wire (pin 5 and 6 have pwm frequency ~1000 Hz, faster than pin 9)
int statusLED = 13;
int delaymsec = 100;
void setup() {
Serial.begin(9600); // opens serial port, sets data rate to 9600 bps
@dlackty
dlackty / gist:3483170
Created August 26, 2012 20:00
OS X Rails Setup
#! /usr/bin/env bash
# llvm-gcc
if `type -P llvm-gcc &>/dev/null`; then
echo "Command Line Tools found."
else
echo "Command Line Tools not found."
echo "Please go https://developer.apple.com/downloads and install **Command Line Tools for Xcode**" && exit 0;
fi
@vi
vi / README
Created September 5, 2012 03:16
Create tun/tap device that just copies all packets to/from the given ethernet interface.
Primary use case: workaround non-working "ip link set wlan0 netns ..." for some network drivers.
Secondary use case: simple demo for getting/setting the MAC address, tun/tap, raw sockets...
Pre-built version: http://vi-server.org/pub/tap_copy
@Shrike1
Shrike1 / google-drive-upload-pdf.php
Created September 5, 2012 03:28 — forked from hubgit/google-drive-upload-pdf.php
Upload a PDF file to Google Drive
<?php
require 'google-api/apiClient.php';
require 'google-api/contrib/apiOauth2Service.php';
require 'google-api/contrib/apiDriveService.php';
$pdfFile = 'test.pdf';
// API Console: https://code.google.com/apis/console/
// Create an API project ("web applications") and put the client id and client secret in config.ini.
@bonyiii
bonyiii / gist:3666732
Created September 7, 2012 14:38
javscript find duplicates
sorted = window.items.sort((a,b) -> a.track_id - b.track_id)
results = []
for item,i in sorted
if i < sorted.length - 1 && sorted[ i + 1 ].element_id == sorted[i].element_id
results.push sorted[i]
results