Skip to content

Instantly share code, notes, and snippets.

View sloria's full-sized avatar

Steven Loria sloria

View GitHub Profile
@staltz
staltz / music.md
Last active September 29, 2023 15:42
coding music

Not for everyone. Each programmer has their own appreciation of what is good coding music.

For when I need to think deep, debug something, or design

(From most influential to least)

@QinMing
QinMing / .zshrc
Last active March 10, 2024 22:17
.zshrc (lazy loading shell functions)
# Copyright (c) 2016-2018 Ming Qin (覃明) <https://github.com/QinMing>
# Open source under MIT LICENSE.
lazy_load() {
# Act as a stub to another shell function/command. When first run, it will load the actual function/command then execute it.
# E.g. This made my zsh load 0.8 seconds faster by loading `nvm` when "nvm", "npm" or "node" is used for the first time
# $1: space separated list of alias to release after the first load
# $2: file to source
# $3: name of the command to run after it's loaded
# $4+: argv to be passed to $3
anonymous
anonymous / dontforget.sh
Created August 5, 2016 11:06
Quick reminders from Terminal (bash) - Linux version
#!/usr/bin/env bash
# dontforget
# Description: A stupid script for short term reminders in bash
# Requires: espeak, mpg123, notify-send, ogg123 (vorbis-tools)
# Source: http://brettterpstra.com/2016/01/22/quick-reminders-from-terminal
# Usage:
#
# Arguments just need to contain a number and a bunch of words.
#
# The number can be anywhere in the arguments, but there shouldn't

Most downloaded projects

SELECT
  file.project,
  COUNT(*) as total_downloads,
FROM
  TABLE_DATE_RANGE(
    [the-psf:pypi.downloads],
    TIMESTAMP("20160114"),
@jmcarp
jmcarp / marshmodel.py
Last active March 5, 2018 01:45
marshmallow-models
import six
import inflection
import marshmallow as ma
class Model(object):
def __init__(self, **kwargs):
self._schema = self.Schema()
self.load(**kwargs)
@paulirish
paulirish / bling.js
Last active February 20, 2024 14:11
bling dot js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
}
NodeList.prototype.__proto__ = Array.prototype;
@gilbert
gilbert / component-sugar.js
Last active August 29, 2015 14:17
Mithril Component Sugar
m.callableComponent = function (componentObj) {
var componentFn = function (props, content) {
return m.component(componentFn, props, content)
}
if (componentObj) {
for (var prop in componentObj) {
componentFn[prop] = componentObj
}
}
return componentFn
var MyComponent = Factory({
willMount: function(element, context) {
console.log('component mounted', element.tagName);
};
willUnmount: function(element, context) {
console.log('component unmount', element.tagName);
};
view: function() {
@barneycarroll
barneycarroll / class.es5.js
Last active August 29, 2015 14:17
ES6 classes in ES5.
var slice = Array.prototype.slice;
function Class( Super, Schema ){
if( arguments.length < 2 ){
Schema = Super;
Super = Object;
}
var constructor = Schema.constructor ? Super ? function SubClass(){
var args = slice.call( arguments );
@bhauman
bhauman / README.md
Last active December 3, 2019 16:43
ClojureScript minimal dev and prod setup.

Recent improvements to the ClojureScript compiler have greatly simplified setting up development versus production outputs.

This example uses Figwheel as something that you want to exclude for production, but the pattern is general.

With this simple setup you only need one html file/view and it will work for developement and production.