Skip to content

Instantly share code, notes, and snippets.

@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
@takeshixx
takeshixx / hb-test.py
Last active April 14, 2025 17:04
OpenSSL heartbeat PoC with STARTTLS support.
#!/usr/bin/env python2
"""
Author: takeshix <[email protected]>
PoC code for CVE-2014-0160. Original PoC by Jared Stafford ([email protected]).
Supportes all versions of TLS and has STARTTLS support for SMTP,POP3,IMAP,FTP and XMPP.
"""
import sys,struct,socket
from argparse import ArgumentParser
@codito
codito / PhoneUnitTestsInTfs.md
Last active August 29, 2015 14:03
Running Windows Phone unit tests in team build (TFS)

Running Windows Phone unit tests in team build (TFS)

Prerequisites:

  • Build Agent needs to run a physical x64 Windows 8.1 based machine to be able to run Phone emulators
  • Setup build agent to run as an interactive process and enable it to run unit tests (obtain developer license). Check this MSDN page for more help on this.
  • Install Visual Studio 2013 + Update 2 (with support for Phone development) on Build Agent

Once you have these, you can use custom scripts in TFS 2013 build definition to run phone tests using vstest.console command line. See the script RunPhoneTests.bat

@nikcorg
nikcorg / berlin-jsconf-2014.md
Last active August 4, 2023 12:45
Slide decks of JSConf 2014
@flamingspaz
flamingspaz / .userconfig
Created January 16, 2015 14:50
nexus-4-kk
export MOZILLA_OFFICIAL=1
export PRODUCTION=1
export CC=clang
export CXX=clang++
export REMOTE_DEBUGGER=1
export GAIA_DEV_PIXELS_PER_PX=2
export DOGFOOD=0
# multilocale stuff, need to clone the locales into B2G/gaia/locales
export LOCALE_BASEDIR=$PWD/gaia/locales
export LOCALES_FILE=$PWD/gaia/locales/languages-dev.json
@janjongboom
janjongboom / gist:8faddcbfc361acab4ec4
Created February 23, 2015 12:02
Flash Jan's experimental build for rpi
  1. Follow instructions to install the prebuilt version for rpi from here: https://wiki.mozilla.org/Hacking_b2g_on_Raspberry_Pi
  2. Boot rpi and connect to wired network. Find the IP it's registered via nmap --open -p 5555 192.168.2.*
  3. Connect over adb: (f.e.) adb connect 192.168.2.100
  4. Checkout jan-os/gecko-dev, rpi branch; and use it as your GECKO_PATH
  5. Think this only works on Ubuntu by the way, but:
  6. In B2G, ./config.sh rpi && ./build.sh gecko && ./flash.sh gecko
  7. Checkout jan-os/janos, gpio branch
  8. Run make reset-phone
  9. adb logcat to see if flashing succeeded
@janjongboom
janjongboom / gist:94d575526a689687a6b8
Last active February 24, 2023 14:40
Firefox OS / JanOS on Raspberry Pi with GPIO support

This does NOT work on Raspberry Pi 2!

  1. Obtain a 8GB (or bigger) SD Card
  2. Download disk image from http://janos.io/builds/fxos-pi-gpio.img.zip and unzip
  3. Put SD card in your computer
  4. Find out where your SD card is mounted (BE REALLY SURE ITS THE RIGHT DEVICE, IT WILL BE WIPED COMPLETELY!!!), f.e. /dev/disk5 on OSX
  5. On Linux, run: sudo dd bs=4M if=fxos-pi-gpio.img of=/path/to/your/disk
  6. On OSX, run: sudo dd bs=4m if=fxos-pi-gpio.img of=/dev/rdisk5 (do rdisk, not disk here!)
  7. When it's done put it in your Pi and start up
  8. The demo's are wired like this: yellow LED on GPIO2, red LED on GPIO3, button (wire it as pulldown) on GPIO26.
@janjongboom
janjongboom / ibeacon.js
Created May 18, 2015 12:42
iBeacon scanning Firefox OS
navigator.mozBluetooth.defaultAdapter.startLeScan([]).then(handle => {
console.log('Start scanning', handle);
handle.ondevicefound = e=> {
var record = parseScanRecord(e.scanRecord);
if (record) {
console.log('Found an iBeacon', record.uuid, record.major, record.minor, e.rssi);
}
}
setTimeout(() => {
@stasm
stasm / abstract.md
Last active August 29, 2015 14:24
New syntax for L20n

New Syntax Proposal for L20n

Goals & Means:

  • Make the most commonly used syntax easy on the eyes by reducing the number of characters used.

@pc035860
pc035860 / version_compare.js
Created October 12, 2015 09:10 — forked from TheDistantSea/version_compare.js
Function to compare two version strings (e.g. "1.6.1" is smaller than "1.7"). Developed in order to answer http://stackoverflow.com/a/6832721/50079.
/**
* Compares two software version numbers (e.g. "1.7.1" or "1.2b").
*
* This function was born in http://stackoverflow.com/a/6832721.
*
* @param {string} v1 The first version to be compared.
* @param {string} v2 The second version to be compared.
* @param {object} [options] Optional flags that affect comparison behavior:
* <ul>
* <li>