Skip to content

Instantly share code, notes, and snippets.

View skorotkiewicz's full-sized avatar
💻
Programming

Sebastian Korotkiewicz skorotkiewicz

💻
Programming
View GitHub Profile
@mixonic
mixonic / server.js
Created April 28, 2011 22:49
Node.js + Socket.io + Bash. A collaborative terminal for your browser.
//
// This server will start a bash shell and expose it
// over socket.io to a browser. See ./term.html for the
// client side.
//
// You should probably:
//
// npm install socket.io
// curl -O https://github.com/LearnBoost/Socket.IO/raw/master/socket.io.min.js
//
@1stvamp
1stvamp / mac-curl-ca-bundle.sh
Created March 22, 2012 12:50
Script to install cURL CA certificates on OS X without macports
#!/bin/bash
mkdir /tmp/curl-ca-bundle
cd /tmp/curl-ca-bundle
wget http://curl.haxx.se/download/curl-7.22.0.tar.bz2
tar xzf curl-7.22.0.tar.bz2
cd curl-7.22.0/lib/
./mk-ca-bundle.pl
if [ ! -d /usr/share/curl/ ]; then
sudo mkdir -p /usr/share/curl/
else
@jscrane
jscrane / spwm.ino
Created July 5, 2012 08:05
Software PWM for Arduino/ATtiny
void spwm(int freq, int pin, int spd) {
digitalWrite(pin, HIGH);
delayMicroseconds(spd * freq);
digitalWrite(pin, LOW);
delayMicroseconds(spd * (255 - freq));
}
int delay = 15;
void loop() {
@iwek
iwek / grab-images-wikipedia.php
Created July 12, 2012 20:38
Retrieve Images from Wikipedia
<?php
/**
* Grab Images from Wikipedia via thier API
*
* @author http://techslides.com
* @link http://techslides.com/grab-wikipedia-pictures-by-api-with-php
*/
//curl request returns json output via json_decode php function
@willread
willread / reverseWords.js
Created August 24, 2012 01:57
Reverse the words in a string
// Reverse words in a string
var reverseWords = function(sentence){
var words = sentence.split(" ").reverse(); // Split the sentence into an array of words and reverse it
var string = "";
for(word in words)
string += (word > 0 ? " " : "") + words[word]; // Concatenate each word to the output and add spaces where required
return string;
@vikrum
vikrum / firedns.js
Created January 14, 2013 18:56
A custom DNS server in NodeJS that saves off queries to Firebase so they can be retrieved later. Accompanying blog post: http://5f5.org/ruminations/dns-debugging-over-http.html
var crypto = require('crypto');
var dns = require('native-dns');
var rest = require('restler');
var server = dns.createServer();
server.on('request', function (request, response) {
var domain = request.question[0].name;
if(domain == 'webutils.flourishworks.com') {
// Don't log this because it can't be uniquely identified and subsequently retrieved
@aido
aido / Polipo-adblocker.sh
Created June 12, 2013 18:01
Use wget and sed to update Polipo forbidden file from http://easylist-downloads.adblockplus.org/easylist.txt
#!/bin/bash +xv
declare WGET=/usr/bin/wget
declare SED=/bin/sed
declare INVOKE=/usr/sbin/invoke-rc.d
#declare TORIFY=/usr/bin/torify
#declare TORRESOLVE=/usr/bin/tor-resolve
declare -i EXIT_VALUE=0
@phuesler
phuesler / netcat_tcp_server.sh
Last active October 7, 2024 14:15
Simple tcp server using netcat
#!/bin/bash
# Simple tcp server using netcat
# - depending on the netcat version either use nc -l 5555 or nc -l -p 5555
# - verify with `telnet locahhost 5555`
# - quit the telnet with `ctrl-]` and then type quit
# - the while loop is there so reopen the port after a client has disconnected
# - supports only one client at a time
PORT=5555;
while :; do nc -l -p $PORT | tee output.log; sleep 1; done
@rknell
rknell / build-release.sh
Last active November 7, 2023 08:23
Build Android Release apk from Cordova /CLI
#!/bin/bash
#Thanks to this page: http://chris-allen-lane.com/2012/12/phonegap-compiling-a-release-apk-without-using-phonegap-build/
#USAGE!
# 1. Replace <AndroidKeyName> with the filename of the keyfile generated (see url)
# 2. Replace <ProjectName> with the project name in the generated file form cordova, see path/to/my/project/platforms/android/bin and look for an APK if you need help
# 3. Replace <AndroidKeyNameAlias> from the alias used when generating the key (see url again!)
# 4. Edit path/to/my/project/platforms/android/AndroidManifest.xml and change "debuggable=false" (search for it!)
# 5. Check path/to/my/project/Release/android for your sparkling new apk!
#
# This worked and was uploadable to the google play store.
@crisu83
crisu83 / dip_bot.js
Created May 5, 2014 11:03
Small script that will help you play "Drowning in Problems" by Notch http://game.notch.net/drowning/#
/*
Open up the developer console in your browser, paste the script below, press enter and enjoy!
*/
var anchors, i;
setInterval(function() {
anchors = document.getElementsByTagName('a');
for (i = 0; i < anchors.length; i++) {
anchors[i].click();
}