Skip to content

Instantly share code, notes, and snippets.

@jaehess
jaehess / binding.js
Created June 5, 2023 22:32 — forked from harish81/binding.js
Simple Two-Way Data Binding Using Javascript Proxies.
function observe(selector,data,listener=null) {
let parent = document.querySelector(selector);
let allBind = parent.querySelectorAll('[data-bind]');
const get = (target, key, receiver)=>{
const result = Reflect.get(target, key, receiver);
return result;
}
const set = (target,key,value,receiver)=>{
Reflect.set(target, key, value, receiver);
updateBinding(key,value);
@jaehess
jaehess / README.md
Created October 12, 2013 14:37 — forked from nikcub/README.md
<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
<AllowedMethod>POST</AllowedMethod>
<AllowedMethod>PUT</AllowedMethod>
<MaxAgeSeconds>3000</MaxAgeSeconds>
<AllowedHeader>*</AllowedHeader>
</CORSRule>
data:text/html, <style type="text/css">#e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div id="e"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("e");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script>
SC.Binding.lt = function (max) {
return this.transform(function (value, binding) {
return SC.typeOf(value) === SC.T_NUMBER && value < max;
});
};
SC.Binding.gt = function (min) {
return this.transform(function (value, binding) {
return SC.typeOf(value) === SC.T_NUMBER && value > min;
});
@jaehess
jaehess / .gitconfig
Created October 24, 2012 13:51 — forked from macournoyer/.gitconfig
Git shortcuts
[alias]
st = status
s = status
co = checkout
ci = commit -a -v
b = branch
d = diff
p = pull
a = add .
l = log
@jaehess
jaehess / cleanup.rb
Created October 12, 2012 16:40 — forked from MoriTanosuke/cleanup.rb
Delete all your tweets from Twitter with Ruby
require 'twitter'
require 'peach'
USERNAME = '' # put your twitter username here
Twitter.configure do |config|
config.consumer_key = YOUR_CONSUMER_KEY
config.consumer_secret = YOUR_CONSUMER_SECRET
config.oauth_token = YOUR_OAUTH_TOKEN
config.oauth_token_secret = YOUR_OAUTH_SECRET
@jaehess
jaehess / easy_way.rb
Created September 2, 2012 14:45 — forked from mislav/easy_way.rb
RESOLVE SHORT URLS before storing. Short URLs are for microblogging; you should never actually keep them around.
require 'net/http'
# WARNING do not use this; it works but is very limited
def resolve url
res = Net::HTTP.get_response URI(url)
if res.code == '301' then res['location']
else url.to_s
end
end
@jaehess
jaehess / chatServer.js
Created August 10, 2012 23:38 — forked from creationix/chatServer.js
A simple TCP based chat server written in node.js
// Load the TCP Library
net = require('net');
// Keep track of the chat clients
var clients = [];
// Start a TCP Server
net.createServer(function (socket) {
// Identify this client
@jaehess
jaehess / 56.html
Created August 8, 2012 22:16 — forked from heapwolf/56.html
socketio/client
<html>
<body>
<script src="http://code.jquery.com/jquery.min.js"></script>
<script src="/socket.io/socket.io.js"></script>
<div id="inputs" style="font-size:60px">
<span>name: </span><input id="username" style="font-size:60px"></input>
</div>
<div id="chat" style="font-size:30"></div>
<script>