Skip to content

Instantly share code, notes, and snippets.

View heptal's full-sized avatar

Michael B heptal

View GitHub Profile
@jordandobson
jordandobson / vignette.css
Created November 25, 2010 09:28
Examples of adding a Vignette to Photos with CSS3 Gradients. Code sampled from: http://cl.ly/3Nxc
/* Border & Vignette Setup */
figure{
position: relative;
display: block;
line-height: 0;
width: 500px;
height: 333px;
margin-bottom: 2em;
border: 1em solid #fff;
@threedaymonk
threedaymonk / srutis.clj
Created August 16, 2012 00:00
Hacking Chris Ford's Overtone code to play Indian scales.
(ns noize.core
(:use [overtone.live :exclude [midi->hz sharp flat scale run pitch shift]]))
(definst harps# [freq 440]
(let [duration 1]
(*
(line:kr 1 1 duration FREE)
(pluck (* (white-noise) (env-gen (perc 0.001 5) :action FREE)) 1 1 (/ 1 freq) (* duration 2) 0.25))))
(def midi-0 8.1757989156)
class DataBuffer {
var internalData: NSData;
init(fromData: NSData) {
self.internalData = NSData.dataWithData(fromData) as NSData;
}
init(fromFilePath: String) {
self.internalData = NSData.dataWithContentsOfFile(fromFilePath, options: .DataReadingMappedIfSafe, error: nil) as NSData;
}
@gridaphobe
gridaphobe / god-state.el
Last active November 21, 2016 14:21
evil-mode god state
(evil-define-state god
"God state."
:tag " <G> "
:message "-- GOD MODE --"
:entry-hook (evil-god-start-hook)
:exit-hook (evil-god-stop-hook)
:input-method t
:intercept-esc nil)
(defun evil-god-start-hook ()
@chroth7
chroth7 / reactD3rescources.md
Last active December 6, 2017 05:37
React/D3 Resources

React <-> D3 Resources

Thanks for all the stars.

Due to unexpected demand, I move this to a proper github repo, see here: https://github.com/chroth7/reactD3resources

I would very much like to get your PRs there, thank you!

@lrvick
lrvick / flask_geventwebsocket_example.py
Created September 1, 2011 07:17
Simple Websocket echo client/server with Flask and gevent / gevent-websocket
from geventwebsocket.handler import WebSocketHandler
from gevent.pywsgi import WSGIServer
from flask import Flask, request, render_template
app = Flask(__name__)
@app.route('/')
def index():
return render_template('index.html')
@codenameyau
codenameyau / console-tricks.js
Last active April 6, 2022 13:07
Javascript Snippets
/************************************************************************
* CLIENT ONE-LINERS
*************************************************************************/
// Set top level domain cookie.
document.cookie = "token=12345; Max-Age=120; Secure; Domain=mozilla.org; Path=/;"
// Set a subdomain cookie.
document.cookie = "name=hello world; Max-Age=120; Secure; Domain=developer.mozilla.org; Path=/;"
@mdunham
mdunham / Create Delete All Messages Button
Last active May 1, 2022 03:08
How to delete all Facebook conversations easily. The script to be run inside Chrome's JavaScript console to delete all the messages and conversations from your Facebook inbox. Instruction: 1 - open your Facebook inbox folder https://www.facebook.com/messages/ 2 - open the Chrome JS console (ALT+CMD+J on Mac OS X) 3 - paste the script and press e…
Simple Method
An easier way to run the script is by simply creating a bookmark in your browser using the following:
Completely, safe.
Bookmark Name: Delete All FB Conversation
Bookmark Url : javascript:!function(){var e=function(o){var n=function(e){var o=function(){var o=document.querySelector("#webMessengerHeaderName").innerText,n=function(e){for(var n=0;n<e.length;n++){var t=e[n];if(-1!==t.innerHTML.indexOf("Delete Conversation"))return console.log("Deleting Messages From: "+o),t.click(),!0}return!1};if("No Selection"===o)return void l();if(!0===n(document.querySelectorAll('a[role="menuitem"]')))setTimeout(t,500);else{var r=document.querySelector('button[data-tooltip-content="Actions"]');if(!r)return void console.log("Unable to locate the delete button");r.click(),setTimeout(e,2e3)}},n=function(){var e=document.querySelector("div.uiScrollableAreaWrap.scrollable");return"undefined"==typeof e||!1===e.hasOwnProperty("scrollHeight")?(console.log("Unable to locate the messages scroll region"),!1):void(e.scro
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: green; icon-glyph: file-code;
module.exports = async ({ url, headers = {} }) => {
const request = new Request(url);
request.method = methods.get;
request.headers = {
...headers
};
return await request.loadString();
@kizzx2
kizzx2 / hammerspoon-move-resize.lua
Last active December 19, 2022 06:47
Hammerspoon script to move/resize window under cursor
-- Inspired by Linux alt-drag or Better Touch Tools move/resize functionality
function get_window_under_mouse()
-- Invoke `hs.application` because `hs.window.orderedWindows()` doesn't do it
-- and breaks itself
local _ = hs.application
local my_pos = hs.geometry.new(hs.mouse.getAbsolutePosition())
local my_screen = hs.mouse.getCurrentScreen()