Skip to content

Instantly share code, notes, and snippets.

@bzg
bzg / emacs-strip.el
Last active January 2, 2023 21:22
Emacs, naked
;; Prevent the cursor from blinking
(blink-cursor-mode 0)
;; Don't use messages that you don't read
(setq initial-scratch-message "")
(setq inhibit-startup-message t)
;; Don't let Emacs hurt your ears
(setq visible-bell t)
;; You need to set `inhibit-startup-echo-area-message' from the
;; customization interface:
@jonathanmorley
jonathanmorley / regex_golf.md
Last active November 16, 2022 17:42 — forked from jpsim/answers.md
Best possible answers collected so far for [Regex golf](http://regex.alf.nu/). === WARNING: SPOILERS ===
@auser
auser / app.js
Last active October 11, 2017 03:01
The complete source for the http://www.ng-newsletter.com/posts/chrome-apps-on-angular.html article. Enjoy!
angular.module('myApp', ['ngRoute'])
.provider('Weather', function() {
var apiKey = "";
this.getUrl = function(type, ext) {
return "http://api.wunderground.com/api/" +
this.apiKey + "/" + type + "/q/" +
ext + '.json';
};
@kejun
kejun / dabblet.css
Created September 5, 2013 03:06 — forked from anonymous/dabblet.css
thumb截中间区域
/* thumb截中间区域 */
fieldset {
display: inline-block;
border: 1px solid #ddd;
}
.thumb {
position: relative;
@aras-p
aras-p / preprocessor_fun.h
Last active May 28, 2024 05:15
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@getify
getify / only-gate.js
Last active July 10, 2018 12:42
asynquence: sequences & gates at a glance. https://github.com/getify/asynquence
ASQ()
.all( // or .gate(..)
// these 3 run "in parallel"
function(done){ setTimeout(done,100); },
function(done){ setTimeout(done,200); },
function(done){ setTimeout(done,300); }
)
.then(function(){
alert("All tasks are complete, and that only took ~300ms, not 600ms!");
});
@Fishrock123
Fishrock123 / genrun.js
Last active December 18, 2015 05:38 — forked from jlongster/testgen.js
basic generator async lib fleshed out to be slightly nicer
// based off of https://gist.github.com/creationix/5544019
// these could probably be condensed more, but I'm just doing this
// quickly
exports = module.exports = run;
exports.call = call;
exports.invoke = invoke;
exports.bind = bind;
@jianingy
jianingy / xmonad.hs
Last active January 4, 2019 05:59
Xmonad Configuration
import XMonad
import XMonad hiding (Tall)
import XMonad.Actions.CycleWS
import XMonad.Actions.FloatKeys
import XMonad.Actions.GridSelect
import XMonad.Hooks.DynamicHooks
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
@paulirish
paulirish / gist:4158604
Created November 28, 2012 02:08
Learn JavaScript concepts with recent DevTools features

Learn JavaScript concepts with the Chrome DevTools

Authored by Peter Rybin , Chrome DevTools team

In this short guide we'll review some new Chrome DevTools features for "function scope" and "internal properties" by exploring some base JavaScript language concepts.

Closures

Let's start with closures – one of the most famous things in JS. A closure is a function, that uses variables from outside. See an example:

@paulrouget
paulrouget / scratchpad.js
Created November 2, 2012 17:59
Floating scrollbars in Firefox
/**
* How to have floating scrollbars in Firefox (Linux, Windows & Mac).
* Screenshot: http://i.imgur.com/bn44L.png
* You need Firefox > 18. Just run this code in a browser-scratchpad:
*
* Ping me on Twitter (@paulrouget) if you run into problems.
*
* 1. Go to about:config - Set devtools.chrome.enabled to true
* 2. Starts Scratchpad (Shift-F4)
* 3. In Scratchpad's menubar, check "Environment > Browser"