Skip to content

Instantly share code, notes, and snippets.

View koesbong's full-sized avatar

Koes Bong koesbong

View GitHub Profile
@koesbong
koesbong / tmux.cheat
Created August 23, 2016 20:05 — forked from afair/tmux.cheat
Tmux Quick Reference & Cheat sheet - 2 column format for less scrolling!
========================================== ==========================================
TMUX COMMAND WINDOW (TAB)
========================================== ==========================================
List tmux ls List ^b w
New -s <session> Create ^b c
Attach att -t <session> Rename ^b , <name>
Rename rename-session -t <old> <new> Last ^b l (lower-L)
Kill kill-session -t <session> Close ^b &
@koesbong
koesbong / amz-s3-bucket-policy
Created August 16, 2016 18:04 — forked from alicial/amz-s3-bucket-policy
Amazon S3 Bucket Policy to prevent hot linking
{
"Version": "2008-10-17",
"Id": "0c762de8-f56b-488d-a4a4-20d1cb31df2f",
"Statement": [
{
"Sid": "Allow in my domains",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
@koesbong
koesbong / README.md
Created January 20, 2016 06:18 — forked from Dr-Nikson/README.md
Auth example (react + redux + react-router)
We’ve built a new communication protocol that sends messages with a restricted syntax.
We need to write a function which determines whether a given message is syntactically valid or not.
Here are the rules:
1. There are 15 valid characters in the protocol: the lower-case characters ‘a’ through ‘j’
and the uppercase characters ‘Z’, ‘M’, ‘K’, ‘P’, and ‘Q’.
2. Every lower-case character in isolation is a valid message, e.g., ‘a’ is a valid message.
3. If σ is a valid message then so is Zσ.
4. If σ and τ are valid messages then so are Mστ , Kστ , Pστ , and Qστ .
5. All other messages are invalid.
@koesbong
koesbong / jquery-context.js
Created March 16, 2012 23:54 — forked from jpcody/jquery-context.js
Maintaining an object and selector context with jQuery
var object = {
handler : function(){
$("selector").on( "click", _.bind( this.doSomething, this ));
},
doSomething : function(e){
function getOptsFromElement(element, attributes) {
var opts = {};
for (var prop in attributes) {
if (attributes.hasOwnProperty(prop)) {
var value = element.getAttribute(attributes[prop]);
if (value) {
opts[prop] = value;
}
}
}
if(document.getElementById('kt_fbLikeButton')) {
var fbLikeButton_opts = {},
fbLikeButton_layout =document.getElementById('kt_fbLikeButton').getAttribute('kt_fbLikeButton:layout'),
fbLikeButton_showface =document.getElementById('kt_fbLikeButton').getAttribute('kt_fbLikeButton:show_face');
fbLikeButton_width =document.getElementById('kt_fbLikeButton').getAttribute('kt_fbLikeButton:width');
if(fbLikeButton_layout) {
fbLikeButton_opts.layout = fbLikeButton_layout;
}
if(fbLikeButton_showface) {
var ktCode = (function() {
function Kontagent(config) {
this.api = null;
this.img = document.createElement('img');
this.url_path = encodeURIComponent(window.location.pathname);
this.st1 = this.getQueryStrings()['st1'] || '';
this.st2 = this.getQueryStrings()['st2'] || '';
this.st3 = this.getQueryStrings()['st3'] || '';
this.kt_cust_id = this.getQueryStrings()['kt_cust_id'] || 'unknown';
this.fb_ref = this.getQueryStrings()['fb_ref'] || '';
package {
import flash.display.Sprite;
import flash.text.Font;
import flash.text.FontType;
import flash.text.FontStyle;
import flash.external.ExternalInterface;
public class FontList extends Sprite
{
MoveNetworksQuantumMediaPlayernpmnqmp071701000001FacebookPlug-In1.0WebExGeneralPluginContainer1.0InstantAction.comGameLauncher1.0GoogleTalkBrowserPlugin1.0iPhotoPhotocast7.0HuluDesktopSupportPlugin1.0SilverlightPlug-In3.0.40818.0Flip4MacWindowsMediaPlugin2.32.3.0.14VeetleTVCoreVLCPlug-inversion0.8.6cVeetleTVPlayerVLCPlug-inversion0.8.6cVeetleBroadcasterPluginVLCPlug-inversion0.8.6cCouponsInc.PluginVersion1.1.5LogMeInPlugin1.0.0.4961.0.496ShockwaveFlash10.1.102.64JavaPlug-In2forNPAPIBrowsers13.4.0QuickTimePlug-in7.6.67.6.6Mozilla/5.0(Macintosh;IntelMacOSX10.6;rv:2.0)Gecko/20100101Firefox/4.0MacIntelen-US1440x900AdobeCaslonProBoldAdobeCaslonProBoldItalicAdobeCaslonProItalicAdobeCaslonProSmBdItalicAdobeGaramondProBoldAdobeGaramondProBoldItalicAdobeGaramondProItalicAmericanTypewriterCondensedAmericanTypewriterCondensedLightAmericanTypewriterLightAppleLiGothicMediumAppleLiSungLightArialBoldArialBoldItalicArialItalicArialNarrowBoldArialNarrowBoldItalicArialNarrowItalicArialRoundedMTBoldAurulentSans-BoldAurulentSans