Skip to content

Instantly share code, notes, and snippets.

View rcdilorenzo's full-sized avatar
🙌
Working in His Kingdom (Col 3:17)

Christian Di Lorenzo rcdilorenzo

🙌
Working in His Kingdom (Col 3:17)
View GitHub Profile
@josevalim
josevalim / 0_README.markdown
Created January 9, 2012 13:07
Hello world of Sinatra-like libraries on Elixir, Ruby and Node.js
@edwardhotchkiss
edwardhotchkiss / angular_app.js
Created May 25, 2012 03:22
Jekyll Live Search with AngularJS (blog)
/**
* Setup Module with `highlight` filter
*/
var JekyllApp = angular.module('JekyllApp', [], function($routeProvider) {
});
JekyllApp.filter('highlight', function() {
return function(text, filter) {
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active July 22, 2024 17:28
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@zoltanctoth
zoltanctoth / gist:5528402
Last active April 9, 2018 11:30
How to install twitter's elephant-bird on EMR
# Get a proper Maven
wget http://xenia.sote.hu/ftp/mirrors/www.apache.org/maven/maven-3/3.0.5/binaries/apache-maven-3.0.5-bin.tar.gz
tar xzf apache-maven-3.0.5-bin.tar.gz
export PATH=/home/hadoop/apache-maven-3.0.5/bin:$PATH
echo 'export PATH=/home/hadoop/apache-maven-3.0.5/bin:$PATH' >> ~/.bash_profile
# Install a supported version of protobuf
sudo apt-get remove protobuf-compiler
wget https://protobuf.googlecode.com/files/protobuf-2.4.1.tar.gz
tar xzf protobuf-2.4.1.tar.gz
@iwasrobbed
iwasrobbed / gist:5528897
Last active June 5, 2020 20:34
UICollectionView w/ NSFetchedResultsController & NSBlockOperation. Idea originated from Blake Watters (https://github.com/AshFurrow/UICollectionView-NSFetchedResultsController/issues/13)
- (void)controllerWillChangeContent:(NSFetchedResultsController *)controller
{
self.shouldReloadCollectionView = NO;
self.blockOperation = [[NSBlockOperation alloc] init];
}
- (void)controller:(NSFetchedResultsController *)controller didChangeSection:(id<NSFetchedResultsSectionInfo>)sectionInfo
atIndex:(NSUInteger)sectionIndex forChangeType:(NSFetchedResultsChangeType)type
{
__weak UICollectionView *collectionView = self.collectionView;
@rcdilorenzo
rcdilorenzo / gist:6437406
Last active December 22, 2015 07:19
CoreGraphics - clipping an inner circle (used in reference to a Stack Overflow question: http://stackoverflow.com/questions/18614376/calayer-clip-cgcontextaddarc-making-a-donut-slide-pie-chart
- (void)drawRect:(CGRect)rect {
UIBezierPath *path = [UIBezierPath bezierPath];
[path addArcWithCenter:CGPointMake(CGRectGetMidX(self.bounds), CGRectGetMidY(self.bounds)) radius:CGRectGetHeight(self.bounds) startAngle:0 endAngle:2.0*M_PI clockwise:YES];
[path addArcWithCenter:CGPointMake(CGRectGetMidX(self.bounds), CGRectGetMidY(self.bounds)) radius:100 startAngle:0 endAngle:2.0*M_PI clockwise:NO];
[path addClip];
self.layer.cornerRadius = 10.0;
CGFloat colors[12] = {
0.1, 0.18, 0.54, 1.0,
@tristanoneil
tristanoneil / harvest
Created October 24, 2013 13:37
How to override Harvest for Mac time settings.
For AppStore apps:
defaults write com.getharvest.harvestxapp TimeFormat hours_minutes
defaults write com.getharvest.harvestxapp TimeFormat decimal
defaults write com.getharvest.harvestxapp TimeFormat server
For apps downloaded directly from GetHarvest:
defaults write ~/Library/Preferences/com.getharvest.harvestx.plist TimeFormat hours_minutes
defaults write ~/Library/Preferences/com.getharvest.harvestx.plist TimeFormat decimal
# Elixir v1.0
defmodule Rules do
defmacro __using__(_) do
quote do
import unquote(__MODULE__)
@before_compile unquote(__MODULE__)
@rules []
end
end
@raven
raven / Breakpoints_v2.xcbkptlist
Last active August 30, 2019 00:53
Symbolic breakpoint for dynamically linking libReveal against UIApplicationMain
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
type = "2"
version = "2.0">
<Breakpoints>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.SymbolicBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
@tfrisk-old
tfrisk-old / gist:11286970
Created April 25, 2014 11:52
Install Erlang and Elixir on Debian Wheezy (7.4)
#!/bin/sh
# Debian has older Erlang package (R15) in official repositories, Elixir requires newer (R17)
wget http://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb
sudo dpkg -i erlang-solutions_1.0_all.deb
sudo apt-get update
sudo apt-get install -y erlang
rm erlang-solutions_1.0_all.deb
# compile Elixir from source