This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (ns todos-example.core | |
| (:require [om.core :as om :include-macros true] | |
| [om-tools.dom :as dom :include-macros true] | |
| [om-tools.core :refer-macros [defcomponent]])) | |
| (def app-state (atom {})) | |
| (def firebase-root "https://cljs-todos.firebaseio.com/todos") | |
| (def r (js/Firebase. firebase-root)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (page "index.html" | |
| (:refer-hoplon :exclude [form]) | |
| (:require | |
| [clojure.string :as string] | |
| [tailrecursion.hoplon.reload :refer [reload-all]])) | |
| ;; auto-reload the page when you modify this file | |
| (reload-all) | |
| ;; UTILITY FUNCTIONS ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Pull this file down, make it executable and run it with sudo | |
| # wget https://gist.githubusercontent.com/bryanhunter/10380945/raw/build-erlang-17.0.sh | |
| # chmod u+x build-erlang-17.0.sh | |
| # sudo ./build-erlang-17.0.sh | |
| if [ $(id -u) != "0" ]; then | |
| echo "You must be the superuser to run this script" >&2 | |
| exit 1 | |
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python2 | |
| """ | |
| Author: takeshix <takeshix@adversec.com> | |
| PoC code for CVE-2014-0160. Original PoC by Jared Stafford (jspenguin@jspenguin.org). | |
| Supportes all versions of TLS and has STARTTLS support for SMTP,POP3,IMAP,FTP and XMPP. | |
| """ | |
| import sys,struct,socket | |
| from argparse import ArgumentParser |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * IE 5.5+, Firefox, Opera, Chrome, Safari XHR object | |
| * | |
| * @param string url | |
| * @param object callback | |
| * @param mixed data | |
| * @param null x | |
| */ | |
| function ajax(url, callback, data, x) { | |
| try { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| %curl -s --user 'api:key-8av0ox9abrs2icvagny' \ | |
| % https://api.mailgun.net/v2/bang.mailgun.org/messages \ | |
| % -F from='Excited User <postmaster@bang.mailgun.org>' \ | |
| % -F to=masquerade2ruslan@gmail.com \ | |
| % -F subject='Hello' \ | |
| % -F text='Testing some Mailgun awesomness!' | |
| -module(mailgun). | |
| -compile(export_all). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| version="2.6.3" | |
| priority="20603" | |
| sudo mkdir -p /var/redis /var/log/redis | |
| curl -sL http://redis.googlecode.com/files/redis-${version}.tar.gz | tar zx | |
| cd redis-${version}/ | |
| make | |
| sudo make PREFIX=/usr/local/redis/${version} install |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Latency Comparison Numbers (~2012) | |
| ---------------------------------- | |
| L1 cache reference 0.5 ns | |
| Branch mispredict 5 ns | |
| L2 cache reference 7 ns 14x L1 cache | |
| Mutex lock/unlock 25 ns | |
| Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
| Compress 1K bytes with Zippy 3,000 ns 3 us | |
| Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
| Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "Customize Flask to select a template based on some criteria." | |
| import os | |
| from flask import Flask, request, render_template | |
| from flask.helpers import locked_cached_property | |
| from jinja2 import FileSystemLoader, TemplateNotFound | |
| # Import a detection utility from your project, not defined here. | |
| # Takes a request object and returns True if browser is mobile. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {%- macro form_field_label(field) -%} | |
| <label for="{{ field.id }}">{{ field.label.text }} | |
| {%- if field.flags.required -%} | |
| <abbr title="Diese Feld muss angegeben werden">*</abbr> | |
| {%- endif %}</label> | |
| {% endmacro %} | |
| {%- macro form_field_description(field) -%} | |
| {% if field.description %} | |
| <span class="descr">{{ field.description }}</span> |