Skip to content

Instantly share code, notes, and snippets.

@elboletaire
elboletaire / powershell_here.reg
Created September 7, 2013 04:04
Open powershell here
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\powershell]
"Icon"="%SystemRoot%\\system32\\WindowsPowerShell\\v1.0\\powershell.exe"
@="Obre powershell"
[HKEY_CLASSES_ROOT\Directory\shell\powershell\command]
@="C:\\\\Windows\\\\system32\\\\WindowsPowerShell\\\\v1.0\\\\powershell.exe -NoExit -NoLogo -Command Set-Location -LiteralPath '%L'"
[HKEY_CLASSES_ROOT\Directory\Background\shell\powershell]
@mattheyan
mattheyan / CommandPromptHere.reg
Last active December 14, 2016 20:24
Command Prompt Here Context Menu
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\Command Prompt Here]
"icon"="C:\\Windows\\system32\\cmd.exe,0"
[HKEY_CLASSES_ROOT\Directory\shell\Command Prompt Here\command]
@="cmd.exe /s /k pushd \"%V\""
[HKEY_CLASSES_ROOT\Directory\Background\shell\Command Prompt Here]
"icon"="C:\\Windows\\system32\\cmd.exe,0"
@pixelbreaker
pixelbreaker / example.js
Last active March 2, 2017 16:13
PouchDB image cache
import ImageCache from './image-cache.js'
var imageCache = new ImageCache();
var img = $(el).find('img');
imageCache.loadImage(img[0], img.attr('src'));
@nolanlawson
nolanlawson / index.html
Last active March 13, 2017 18:44
Demonstrate attachments in PouchDB
<html>
<body>
<pre id="display"></pre>
<script src="//cdn.jsdelivr.net/pouchdb/3.1/pouchdb.js"></script>
<script>
(function () {
'use strict';
var display = document.getElementById('display');
display.innerHTML = (display.innerHTML || '');
var count = function(txt, rank) {
var wordFreq = {};
var words = txt.split(' ');
for (i = 0; i < words.length; i++) {
var current = words[i];
var last = current.length - 1;
current = noPunc(current);
if (notInArray(current, particle) && !wordFreq[current]) {
wordFreq[current] = 1;
}
const someReallyUsefullFunction = async (text) => {
// Break in parts small enough to be handle by Polly API
const parts = divideTextEnoughToBeHandleByPolly(text)
// Concat AudioStreams in one Buffer
const audioStreams = audios.map(a => a.AudioStream)
const buffer = Buffer.concat(audioStreams, audioStreams.reduce((len, a) => len + a.length, 0))
...
}
@jshbrntt
jshbrntt / pan-zoom-image.js
Last active October 16, 2018 11:10
A simple way of panning and zooming an image using Hammer.js.
// <img id="myimage" src="http://placecage/1280/720">
var image = document.getElementById('myimage');
var mc = new Hammer.Manager(image);
var pinch = new Hammer.Pinch();
var pan = new Hammer.Pan();
pinch.recognizeWith(pan);
@travismillerweb
travismillerweb / scroll-shadow.css
Created September 23, 2013 18:57
CSS - Google Scroll Shadow
/*
Gmail/Google Reader Sidebar Scroll Shadows
-------------------------------------------
Neat effect that mimics the scroll shadows that appear in the GOogle sitde bar and visually cues users to scroll up or down depending on their position.
Credit goes to Lea Verou for this awesome find.
Source:
Lea's Talk: http://www.youtube.com/watch?v=3ikye7Qc7Ak
Code Source: http://lea.verou.me/more-css-secrets/#slide9
@jhidalgo3
jhidalgo3 / downloader.js
Last active January 16, 2021 09:48
Use NodeJS to download files
var path = require('path');
var url = require('url');
var http = require('http');
var fs = require('fs');
var write_file;
//what global variable do we have?
var complete = false;
var content_length = 0;
var downloaded_bytes = 0;
@wildlyinaccurate
wildlyinaccurate / event.js
Last active February 12, 2021 01:05
Really simple Javascript custom event system
var Event = function() {
var self = this;
self.queue = {};
self.fired = [];
return {
fire: function(event) {