Skip to content

Instantly share code, notes, and snippets.

View Shilo's full-sized avatar

Shilo Shilo

View GitHub Profile
@eegrok
eegrok / mac-keycodes
Last active May 7, 2024 13:45
Mac virtual keycodes
from: http://www.meandmark.com/keycodes.html
with some additions from people in the comments, thanks :)
Virtual Keycodes for the Mac QWERTY Layout
Keycodes are in hexadecimal. A blank entry means either there is no key assigned to that keycode or I was unable to find the assigned key.
Keycode Key
0x00 A
0x01 S
0x02 D
@jamztang
jamztang / LICENSE
Created January 6, 2012 18:48
Creating a placeholder UIImage dynamically with color
Copyright (c) 2013 Jamz Tang <jamz@jamztang.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
@jasonrdsouza
jasonrdsouza / key_detect.py
Created February 24, 2012 15:54
Python function to get keypresses from the terminal
def getchar():
#Returns a single character from standard input
import tty, termios, sys
fd = sys.stdin.fileno()
old_settings = termios.tcgetattr(fd)
try:
tty.setraw(sys.stdin.fileno())
ch = sys.stdin.read(1)
finally:
termios.tcsetattr(fd, termios.TCSADRAIN, old_settings)
@skrb
skrb / Test.java
Created April 8, 2012 02:04
JavaFX WebView Sample
import java.io.IOException;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.StackPane;
import javafx.scene.web.WebEngine;
import javafx.scene.web.WebView;
import javafx.stage.Stage;
public class Test extends Application {
@conorbuck
conorbuck / angle-between-points.js
Created May 5, 2012 22:51
JavaScript: Find the angle between two points
var p1 = {
x: 20,
y: 20
};
var p2 = {
x: 40,
y: 40
};
@Botffy
Botffy / NiochatServer.java
Created October 9, 2012 18:45
simple Java NIO chat server
package niochat;
import java.net.*;
import java.nio.*;
import java.nio.channels.*;
import java.io.IOException;
import java.util.*;
public class NiochatServer implements Runnable {
private final int port;
@xero
xero / css-injection.html
Last active October 22, 2021 08:03
css style injection via jQuery. basically calling body/head append with a style tag and your own css will add a new tag and your styles to the bottom of the page/head and override any existing ones. why is this useful? imagine embedding a single js file into the page and defining your own styles (think widget for a client), or loading css via aj…
<!DOCTYPE html>
<html>
<head>
<title>css injection | xero.nu</title>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<style type="text/css">
body{
font: normal 12pt "Times New Roman", serif;
background: #ccc;
color: #000066;
@Shilo
Shilo / NSString+XML.h
Last active December 22, 2015 03:19
Customizable string XML parser for NSString, NSMutableString, NSAttributedString, and NSMutableAttributedString.
//
// NSString+XML.h
// Customizable string XML parser for NSString, NSMutableString, NSAttributedString, and NSMutableAttributedString.
//
// Created by Shilo White on 8/31/13.
// Copyright (c) 2013 XIDA Design & Technik. All rights reserved.
//
#import <Foundation/Foundation.h>
@Shilo
Shilo / remove_svn_dirs.sh
Created October 24, 2013 05:34
Bash script command to recursively remove ".svn" directory from currently directory.
rm -rf `find . -type d -name .svn`
@rcotrina94
rcotrina94 / How to use Images as Radio buttons.md
Last active February 22, 2024 13:29
How to use images for radio buttons (input-radio).