Skip to content

Instantly share code, notes, and snippets.

View daBayrus's full-sized avatar
🍜

라가나 조엘 daBayrus

🍜
View GitHub Profile
@kennwhite
kennwhite / reset_osx_attributes.sh
Created September 1, 2013 03:10
Remove all extended attributes recursively on an OSX directory & files and fix "chown: ... Operation not permitted" and "chmod: ... Operation not permitted"
# This is the nuclear option. Use with extreme care
# Works up to and including Mountain Lion (10.8.x)
# Show all extended attributes
ls -lOe ~/dir-to-fix
# Remove no-change attributes
sudo chflags nouchg ~/dir-to-fix
# Recursively clear all entended attributes
@jikkujose
jikkujose / .tmux.conf
Created November 17, 2013 04:37
Change prefix key in tmux to back-tick and still type back-ticks
unbind C-b
set-option -g prefix `
bind ` send-prefix
@favadi
favadi / redmine.conf
Last active January 18, 2020 01:59
Manage redmine with unicorn, rbenv and supervisord
[program:redmine]
command=/home/redmine/start_redmine.sh
user=redmine
directory=/home/redmine
stderr_logfile=/var/log/supervisor/redmine_error.log
stdout_logfile=/var/log/supervisor/redmine_out.log
environment=HOME="/home/redmine"
@normancapule
normancapule / deploy.rb
Created March 5, 2014 13:50
Sample Capistrano 3.1 Config
# config valid only for Capistrano 3.1
lock '3.1.0'
set :application, '<application_name>'
set :repo_url, '<url.git>'
set :deploy_via, :remote_cache
# Default branch is :master
# ask :branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp }
@arnaudbreton
arnaudbreton / rsync-auto grunt alternative.coffee
Last active March 25, 2020 04:45
Gruntfile to trigger new Vagrant 1.5 rsync command when catching changes. Faster than Vagrant rsync-auto bundled command, mainly because Grunt only watches specified paths while Guard/Listen (used internally by Vagrant) watches the whole (sub)-folders.
terminal = require('color-terminal')
log = (error, stdout, stderr, cb) ->
if error
terminal.color('red').write stdout
else
terminal.color('green').write stdout
cb()
@siawyoung
siawyoung / post_to_slack.rb
Created March 16, 2015 04:39
Script for posting to Slack's incoming webhooks
require 'json'
require 'optparse'
require 'net/http'
require 'net/https'
def parse_options(argv)
#######################################
# Please change the following as needed
#######################################
<?
/////////////////////
// slack2html
// by @levelsio
/////////////////////
//
/////////////////////
// WHAT DOES THIS DO?
/////////////////////
//
@normancapule
normancapule / Notes
Last active October 14, 2015 11:27
How we deal with TIMEZONES!
1. User.timezone comes from momentjs moment().format("Z")
2. Everytime user logs in, we pass the browser's timezone
3. Session controller updates user timezone
@bishboria
bishboria / springer-free-maths-books.md
Last active April 19, 2026 15:50
Springer made a bunch of books available for free, these were the direct links
@ljharb
ljharb / array_iteration_thoughts.md
Last active March 31, 2026 18:26
Array iteration methods summarized

Array Iteration

https://gist.github.com/ljharb/58faf1cfcb4e6808f74aae4ef7944cff

While attempting to explain JavaScript's reduce method on arrays, conceptually, I came up with the following - hopefully it's helpful; happy to tweak it if anyone has suggestions.

Intro

JavaScript Arrays have lots of built in methods on their prototype. Some of them mutate - ie, they change the underlying array in-place. Luckily, most of them do not - they instead return an entirely distinct array. Since arrays are conceptually a contiguous list of items, it helps code clarity and maintainability a lot to be able to operate on them in a "functional" way. (I'll also insist on referring to an array as a "list" - although in some languages, List is a native data type, in JS and this post, I'm referring to the concept. Everywhere I use the word "list" you can assume I'm talking about a JS Array) This means, to perform a single operation on the list as a whole ("atomically"), and to return a new list - thus making it mu