Skip to content

Instantly share code, notes, and snippets.

@sammachin
sammachin / gist:8298386
Created January 7, 2014 12:07
Hack the CES Scavenger hunt ;-) You'll need a recent mac with BT4.0 running mavericks, and a copy of bleacon (npm install bleacon) start the scavenger hunt, then run this script and sit back.
#! /usr/bin/env node
var Bleacon = require('bleacon');
var uuid = '842AF9C408F511E39282F23C91AEC05E';
var major = 65000;
var measuredPower = -59;
function myLoop(){
setTimeout(function () {
Bleacon.stopAdvertising();
@ghostbitmeta
ghostbitmeta / pushbullet.php
Created May 30, 2015 00:17
Synology + Pushbullet
<?php
// Used code from the following sources:
// https://gist.github.com/styxit/e34d4c6f8cb23d55f5af#file-synology-pushover-php
// http://pastebin.com/iHAFAHGq
// Thanks to: https://styxit.com/2014/05/10/synology-pushover.html
// Only allow request made by localhost?
@santiagobasulto
santiagobasulto / README.md
Last active May 16, 2021 10:13
Download HumbleBundle books in batch with a simple Python script.

Download HumbleBundle books

This is a quick Python script I wrote to download HumbleBundle books in batch. I bought the amazing Machine Learning by O'Reilly bundle. There were 15 books to download, with 3 different file formats per book. So I scratched a quick script to download all of them in batch.

(Final Result: books downloaded)

import SwiftUI
struct ContentView: View {
static var toggle = false
static let settings: [Setting] = [
.push(
label: "Embedded content",
[
.text(label: "Deeper!", "Here is some embedded informational text")
]
@HaNdTriX
HaNdTriX / image_to_data_url.js
Last active February 27, 2022 07:23
Convert an image to base64URL.
/**
* Converts an image to a dataURL
* @param {String} src The src of the image
* @param {Function} callback
* @param {String} outputFormat [outputFormat='image/png']
* @url https://gist.github.com/HaNdTriX/7704632/
* @docs https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement#Methods
* @author HaNdTriX
* @example
*
@ChuckWoodraska
ChuckWoodraska / dash_runner.py
Last active June 4, 2022 11:28
Used to sniff traffic for Amazon dash button and play a song through my chromecast.
import time
import sys
import logging
import pychromecast
from scapy.all import *
mac_address = '00:00:00:00:00:00'
def arp_display(pkt):
if pkt[ARP].op == 1:
if pkt[ARP].hwsrc == mac_address:
@rollxx
rollxx / gist:2689219
Created May 13, 2012 16:40
iStat trial reset
rm ~/Library/Preferences/com.bjango.istatmenus.plist
@frank-dspeed
frank-dspeed / get-es-path.mjs
Created January 23, 2020 09:54
Method to get Current File Path inside ESM
//import.meta.url
function getPath(url) {
let result = new URL(import.meta.url)
let pathname = result.pathname
let pathArray = pathname.split('/')
let basename = pathArray.pop()
let dirname = pathArray.join('/')
return { pathname, dirname,basename}
}
@kirilkirkov
kirilkirkov / gist:b13baec4b5142a527399693f8829547d
Created June 21, 2016 07:20
Difference between png-Interlaced, jpg-progressive AND png-non-Interlaced, jpg-baseline
Interlaced image loads an early degraded version of the whole image as soon as possible and then progressively renders the image to clear state.
Non-interlaced image will load up in tiles showing clear image in each tile as it progresses to load in the image.
For .jpg the interlaced = progressive and not interlaced = baseline.