Skip to content

Instantly share code, notes, and snippets.

View yoonwaiyan's full-sized avatar
🏠
Working from home

Wai Yan Yoon yoonwaiyan

🏠
Working from home
View GitHub Profile
@dip00dip
dip00dip / crontab
Created May 15, 2012 12:28
kill all leaking rails processes runnning via passenger
# every 5 minutes run this script ↓
*/12 * * * * /path/to/kill_memleaked_rails.sh
@ThomasLeister
ThomasLeister / convert-mp4-to-mp3
Created July 24, 2014 08:24
Converts MP4 video files to MP3 audio files via ffmpeg
#!/bin/sh
for f in *.mp4;
do
echo "Processing $f"
ffmpeg -i "$f" "output/${f%}.mp3"
done
@joscha
joscha / meteor-async.md
Last active August 29, 2017 06:51 — forked from possibilities/meteor-async.md
Meteor Async Guide

From Meteor's documentation:

In Meteor, your server code runs in a single thread per request, not in the asynchronous callback style typical of Node. We find the linear execution model a better fit for the typical server code in a Meteor application.

This guide serves as a mini-tour of tools, trix and patterns that can be used to run async code in Meteor.

Basic async

Sometimes we need to run async code in Meteor.methods. For this we create a Future to block until the async code has finished.

@cheeaun
cheeaun / rdrc2016.md
Last active June 13, 2018 08:39
RedDotRubyConf 2016 links & resources 😘
@ball-hayden
ball-hayden / README.md
Last active September 21, 2018 09:07
ActiveAdmin Bootstrap

ActiveAdmin Bootstrap

This is a rough proof of concept.

There will be broken things.

Comments are welcome.

Installation

@bigfive
bigfive / active_admin_helper.rb
Last active November 15, 2018 21:33
Active admin reskin
module ActiveAdminHelper
def admin_arbre_context
@admin_arbre_context ||= Arbre::Context.new(assigns, self)
end
def default_renderer
case controller.send(:resource_class).name
when "ActiveAdmin::Page"
"page"
@EtienneDepaulis
EtienneDepaulis / active_admin.css.scss
Created November 14, 2012 08:18
jQuery Datatables + Active Admin
@import "dataTables/jquery.dataTables";
/* A modifier pour avoir les bons espacements */
body.active_admin .data_table {
padding-bottom: 10px;
}
body.active_admin .dataTables_paginate {
margin-top: -10px;
@sebmarkbage
sebmarkbage / JSXSpreadAttributes.md
Last active August 13, 2020 15:18
JSX Spread Attributes

JSX Spread Attributes

If you know all the properties that you want to place on a component a head of time, it is easy to use JSX:

  var component = <Component foo={x} bar={y} />;

Mutating Props is Bad, mkay

@freekmurze
freekmurze / deploy.php
Last active February 5, 2021 02:43
A sample deploy.php file that can be used with Deployer (http://deployer.in)
<?php
/*
* Define the servers
*/
server('production-web', '<your server url>')
->path('<path to the project on your server>')
->user('<user on the server>')
->pubKey();
/*
@ruckus
ruckus / gist:2293434
Created April 3, 2012 16:36
Basic setup of WAL-E for continuous archiving and recovery

WAL-E needs to be installed on all machines, masters and slaves.

How to install WAL-E

Only one machine, the master, writes WAL segments via continuous archiving. The configuration for the master postgresql.conf is:

archive_mode = on
archive_command = 'envdir /etc/wal-e.d/env wal-e wal-push %p'
archive_timeout = 60