Skip to content

Instantly share code, notes, and snippets.

View booyaa's full-sized avatar
🏠
Working from home forevah!

Mark Sta Ana booyaa

🏠
Working from home forevah!
View GitHub Profile
@christianberg
christianberg / .tmux.conf
Created January 25, 2013 14:23
tmux config
set -g bell-action any
set -g default-terminal xterm
set -g display-panes-colour red
set -g message-bg cyan
set -g message-fg white
set -g mouse-select-pane on
set -g pane-border-bg default
set -g pane-border-fg cyan
set -g pane-active-border-bg default
set -g pane-active-border-fg white
@jdkanani
jdkanani / notepad.html
Last active June 16, 2024 13:44 — forked from jakeonrails/Ruby Notepad Bookmarklet
This bookmarklet gives you a code editor in your browser with a single click.
data:text/html, <style type="text/css">.e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div class="e" id="editor"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("editor");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script>
<!--
For other language: Instead of `ace/mode/ruby`, Use
Markdown -> `ace/mode/markdown`
Python -> `ace/mode/python`
C/C++ -> `ace/mode/c_cpp`
Javscript -> `ace/mode/javascript`
Java -> `ace/mode/java`
Scala- -> `ace/mode/scala`
@creationix
creationix / parallelclient.js
Created February 1, 2013 22:39
test to show that client agent throttles to 5 connections by default.
var http = require('http');
var count = 0;
function get() {
var i = count++;
console.log("Starting request #" + i);
var req = http.request({
hostname: "localhost",
port: 8080,
@pvdissel
pvdissel / .tmux.conf
Created February 18, 2013 08:58
My tmux config
# Setting the prefix from C-b to C-a
set -g prefix C-a
# Free the original Ctrl-b prefix keybinding
unbind C-b
# Setting the delay between prefix and command
set -s escape-time 1
# Ensure that we can send Ctrl-A to other apps
@macodev
macodev / gist:4985042
Created February 19, 2013 11:31
Mac OSX custom keybindings in ˜/Library/KeyBindings/DefaultKeyBinding.dict for IT keyboard
{
/* Custom Key Bindings */
"§" = ("insertText:", "}");
"°" = ("inesertText:", "{");
"ç" = ("insertText:", "#");
}
@whatupdave
whatupdave / check.sh
Created March 4, 2013 20:53
Text me when Mojang updates the Minecraft server
#!/bin/bash
old_etag=$(curl --silent http://api.openkeyval.org/minecraft-etag)
new_etag=$(curl --silent --head https://s3.amazonaws.com/MinecraftDownload/launcher/minecraft_server.jar | grep ETag | awk -F\" '{print $2}')
if [ $old_etag != $new_etag ]; then
echo "event=updated old=$old_etag new=$new_etag"
curl --silent -X POST https://api.twilio.com/2010-04-01/Accounts/$TWILIO_USER/SMS/Messages.json \
-u $TWILIO_USER:$TWILIO_PASS \
-d "From=$SMS_FROM" \
@VRMink
VRMink / gist:5169211
Last active January 6, 2020 20:31
How to setup a private node.js web server with SSL authorization

Secure private web server with NodeJS

This article will explain how to set up a secure web server with NodeJS which only accepts connection from users with SSL certificates that you have signed. This is an efficient way to ensure that no other people are able to access the web server, without building a login system which will be significantly weaker.

I will not explain how to create a certificate authority (CA), create certificates or sign them. If you need to read up on this, have a look at this excelent article on how to do it with OpenSSL (Mac and Linux): https://help.ubuntu.com/community/OpenSSL#Practical_OpenSSL_Usage It is also possible to do this on a Mac with the keychain application, and I assume it is possible on a Windows machine aswell.

This architecture will allow you to have one web server communicating with an array of trusted clients, the web server itself can be on the public internet, that will not decrease the level of security, but it will only ser

@trastle
trastle / timestamp.js
Created April 19, 2013 09:34
Timestamp in JS (yuk)
function timeStamp() {
var d = new Date();
var hour = ('0' + d.getHours()).slice(-2);
var min = ('0' + d.getMinutes()).slice(-2);
var sec = ('0' + d.getSeconds()).slice(-2);
var mil = ('000' + d.getMilliseconds()).slice(-3);
return hour + ":" + min + ":" + sec + "(" + mil + ")";
}
@willurd
willurd / web-servers.md
Last active May 18, 2025 17:06
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@SteveSwink
SteveSwink / CaptureScreenshot.cs
Created August 14, 2013 20:15
Screenshot grabber for unity
using UnityEngine;
using System.Collections;
using System.IO;
public class CaptureScreenshot : MonoBehaviour {
public int sizeMultiplier = 2;
public string prefix = "Scale_Screen";
int incrementValue = 0;