Skip to content

Instantly share code, notes, and snippets.

View array.swift
class ArrayImpl<T> {
var space: Int
var count: Int
var ptr: UnsafeMutablePointer<T>
init(count: Int = 0, ptr: UnsafeMutablePointer<T> = nil) {
self.count = count
self.space = count
@y0ast
y0ast / Tutorial.md
Last active Nov 23, 2015
Tutorial for using Torch7 on Amazon EC2 GPUs
View Tutorial.md

There used to be a tutorial here for using Torch7 on EC2, but it's now outdated. It is best to use an EC2 image that already has Torch7 and CUDA stuff preinstalled.

@elithrar
elithrar / wale_postgres_recovery.md
Last active Mar 20, 2019
WAL-E + Postgres 9.x (single server + DB) Setup and Recovery
View wale_postgres_recovery.md

A quick "how to" on what you need to do to both setup AND recover a single-server PostgreSQL database using WAL-E

  • WAL-E: https://github.com/wal-e/wal-e
  • Assuming Ubuntu 12.04 LTS ("Precise")
  • We'll be using S3. Make sure you have an IAM in a group with GetObject, ListBucket and PutObject on the bucket you want to use (and that it's not public).

Setup:

  1. These packages:
@jehiah
jehiah / notify.sh
Created Jan 19, 2014
email notify at system boot time
View notify.sh
#!/bin/bash
#
# *************************************************
# chkconfig: 2345 99 99
# description: notify email address on system boot.
# *************************************************
# Installing:
# 1) save as /etc/rc.d/init.d/notify
# 2) set the desired email address in "MAILADD" variable
# 3) chmod a+w /etc/rc.d/init.d/notify
@jehiah
jehiah / check_swap_paging_rate.sh
Created Jan 19, 2014
Nagios Monitor for the rate pages are swapped in/out
View check_swap_paging_rate.sh
#!/bin/bash
# Show the rate of swapping (in number of pages) between executions
OK=0
WARNING=1
CRITICAL=2
UNKNOWN=-1
EXITFLAG=$OK
WARN_THRESHOLD=1
@jehiah
jehiah / check_forkrate.sh
Created Jan 19, 2014
check_forkrate.sh script to monitor system fork rate with nagios
View check_forkrate.sh
#!/bin/bash
# Copyright bitly, Aug 2011
# written by Jehiah Czebotar
DATAFILE="/var/tmp/nagios_check_forkrate.dat"
VALID_INTERVAL=600
OK=0
WARNING=1
CRITICAL=2
@fs111
fs111 / gist:7013230
Created Oct 16, 2013
These are the notes from my talk about lingual during the big data beer meetup in Berlin: http://www.meetup.com/Big-Data-Beers/events/143392512/
View gist:7013230

Lingual - ANSI SQL for apache hadoop

Big Data Beers Berlin, October 16th 2013

Speaker

  • André Kelpe | @fs111 | andre[at]concurrentinc[dot]com
  • works for concurrent inc (http://concurrentinc.com)
    • company behind Cacading and Lingual

Cascading

@dergachev
dergachev / GIF-Screencast-OSX.md
Last active Apr 18, 2019
OS X Screencast to animated GIF
View GIF-Screencast-OSX.md

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@mattt
mattt / NSHipster-Call-For-Tricks-And-Tips.md
Created Nov 26, 2012
NSHipster Call for Tips & Tricks!
View NSHipster-Call-For-Tricks-And-Tips.md

Howdy howdy, NSHipsters!

If you alloc init an NSCalendar, you'll notice that New Year's Eve falls on a Monday this year, a.k.a. "the day NSHipster is published every week". What fun!

So in celebration of the upcoming year++, I thought it'd be fun to compile a list of some of your favorite tips and tricks of the trade. Submit your favorite piece of Objective-C trivia, framework arcana, hidden Xcode feature, or anything else you think is cool, and you could have it featured in the year-end blowout article. Just comment on this gist below!

Here are a few examples of the kind of things I'd like to see:

@larsxschneider
larsxschneider / github.com.js
Created Oct 31, 2012 — forked from agnoster/github.com.js
View/edit a file in a pull request by clicking on the line number.
View github.com.js
/**
* 1) Use http://defunkt.io/dotjs/
* 2) Install this into ~/.js/github.com.js
* 3) Click on a line number in the editor to open the file at this position (e.g. to see more context)
* 4) Alt+Click on a line number in the editor to edit the file at this position
*
* This script is based on @agnoster's idea: https://gist.github.com/3906361
*/
function getBranch() {
You can’t perform that action at this time.