Skip to content

Instantly share code, notes, and snippets.

@takeshixx
takeshixx / hb-test.py
Last active March 9, 2024 13:37
OpenSSL heartbeat PoC with STARTTLS support.
#!/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
@aurman
aurman / exampleOauth.php
Last active July 4, 2022 13:00
SmartThings .php example authenticating and controlling SmartThings API endpoints
<?php
//client id and client secret
$client = '';
$secret = '';
//hardcode the full url to redirect to this file
$url = "";
//STEP 1 - Get Access Code
@aurman
aurman / enpointExample.groovy
Created March 27, 2014 17:33
SmartThings API Endpoint Example
/**
* App Endpoint API Access Example
*
* Author: SmartThings
*/
preferences {
section("Allow Endpoint to Control These Things...") {
input "switches", "capability.switch", title: "Which Switches?", multiple: true
input "locks", "capability.lock", title: "Which Locks?", multiple: true
@DavidBruant
DavidBruant / ScreenTreeNode.js
Created August 25, 2013 21:36
2D BSP in JavaScript
(function(global){
"use strict";
function constEnumPropValueDesc(v){
return {
value: v,
enumerable: true,
configurable: false,
writable: false
};
@yurydelendik
yurydelendik / gist:5953383
Created July 8, 2013 23:31
Making simple barcode scanner for Firefox OS
@arcturus
arcturus / crossdomainrequest.js
Created December 28, 2012 20:34
How to do a cross domain request in Firefox OS
/*
YOU'LL BE ABLE TO PERFORM A CROSS DOMAIN REQUEST IF YOUR APP IS CERTIFIED OR PRIVILEDGED.
FOR MORE INFO CHECK THE PERMISSIONS MATRIX: https://docs.google.com/spreadsheet/ccc?key=0Akyz_Bqjgf5pdENVekxYRjBTX0dCXzItMnRyUU1RQ0E#gid=0
First you'll need to setup the permission for doing the cross domain request on your application manifest.
Go to your app manifest, to the permissions section and add the following:
"systemXHR": {}
@bruth
bruth / gist:2865951
Last active November 19, 2017 20:11
Backbone Sync Queue
# Reference Backbone ajax function
_ajax = Backbone.ajax
requestQueue = []
requestPending = false
sendRequest = (options, promise, trigger=true) ->
options = _.clone options
if trigger
requestPending = true
@hawkrives
hawkrives / README.md
Created April 4, 2012 20:18
VB Word-to-Markdown converter

from http://tips.naivist.net/2006/02/02/word_to_markdown_converter/ Word to Markdown converter

Some smart people who didn’t want to teach users how to code in HTML invented Textile markup language

Someone more lazy invented MarkDown syntax which is much easier to learn. MarkDown is really nice for small content management systems, blogging engines etc.

For instance, to mark text as bold, you write the “bold text” like “bold text”. Other rules can be found in the syntax page.

However, when you have a MS Word document with several pages of bolds, italics and lists, you don’t really want to re-code all the markup.

@gre
gre / EasingFunctions.json
Last active January 11, 2023 10:28
DEPRECATED Please use http://github.com/gre/bezier-easing for latest vrrsion.
{
"ease": [0.25, 0.1, 0.25, 1.0],
"linear": [0.00, 0.0, 1.00, 1.0],
"ease-in": [0.42, 0.0, 1.00, 1.0],
"ease-out": [0.00, 0.0, 0.58, 1.0],
"ease-in-out": [0.42, 0.0, 0.58, 1.0]
}
@cojohn
cojohn / basic-http-auth-node.js
Created February 8, 2012 18:53
Basic HTTP Authorization Header in Node.js
var key = <my key>,
secret = <my secret>,
https = require("https"),
https_options = {
"host": <host>,
"path": <path>,
"port": <port>,
"method": <method>,
"headers": {
"Authorization": "Basic " + new Buffer(key + ":" + secret, "utf8").toString("base64")