This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var http = require('http'), | |
| bl = require('bl'); | |
| function handler(req, res) { | |
| req.pipe(bl(function (err, data) { | |
| if (err) { | |
| console.log(err) | |
| res.writeHead(400, {'Content-Type': 'text/plain'}); | |
| res.end('Error receiving data'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from threading import Thread | |
| import socket | |
| import sys | |
| class Server(Thread): | |
| def __init__(self, host='', port=1337): | |
| super().__init__() | |
| self.host = host | |
| self.port = port |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| ssh_url="git@github.com" | |
| base_path="/home/git/deploy" | |
| repo_dir="$base_path/repos" | |
| processing="$base_path/processing" | |
| getter="$base_path/github-getter" | |
| post_receive="$base_path/post-receive" | |
| full_name="itsapi/github-getter" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sys | |
| def getTerminalSize(): | |
| import os | |
| env = os.environ | |
| def ioctl_GWINSZ(fd): | |
| try: | |
| import fcntl, termios, struct, os | |
| cr = struct.unpack('hh', fcntl.ioctl(fd, termios.TIOCGWINSZ, '1234')) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import sys | |
| import colors | |
| class Node(): | |
| _OPT = { | |
| 'depth': False, | |
| 'colors': True, | |
| 'abspath': False, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sys | |
| def _has_colors(stream): | |
| if not hasattr(stream, 'isatty'): | |
| return False | |
| if not stream.isatty(): | |
| return False | |
| try: | |
| import curses |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Trigger my NFC unlock to lock the computer | |
| curl http://localhost:6001/?secret=secret | |
| # Send standby signal | |
| dbus-send --system --print-reply --dest="org.freedesktop.UPower" /org/freedesktop/UPower org.freedesktop.UPower.Suspend |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function github_req(user, cb) { | |
| makeRequest( | |
| 'https://api.github.com/users/' + user + '/events', | |
| function (text) { | |
| var data = JSON.parse(text); | |
| cb(data); | |
| } | |
| ); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Convert YouTube to MP3 */ | |
| javascript:window.open('http://www.video2mp3.net/loading.php?url='+window.location) | |
| /* Include jQuery */ | |
| javascript:(function(a){if(!a.jQuery){var d=document,b=d.createElement('script');b.src='//code.jquery.com/jquery-latest.js';d.getElementsByTagName('head')[0].appendChild(b)}})(this) | |
| /* View Source */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var http = require('http'), | |
| url = require('url'), | |
| exec = require('child_process').exec; | |
| var locked = false; | |
| var app = http.createServer(function(request, response) { | |
| var url_parts = url.parse(request.url, true); | |
| var path = url_parts.pathname.replace(/^\/|\/$/g, ''); |