Skip to content

Instantly share code, notes, and snippets.

View marcolink's full-sized avatar
🪐

Marco Link marcolink

🪐
View GitHub Profile
#Requires
%w(rubygems rake webrick net/http fileutils daemons).each {|lib| require lib}
@config = {
#Files to compile
:targets => {
"source/classes/spfc_main.as" => "public/spfc_main.swf",
"source/classes/spfc_intro.as" => "public/spfc_intro.swf",
"source/classes/spfc_loader.as" => "public/spfc_loader.swf",
"source/classes/test.as" => "public/test.swf"
@isaacs
isaacs / node-and-npm-in-30-seconds.sh
Last active June 18, 2024 18:27
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@andrewgleave
andrewgleave / iOSMapKitFitAnnotations.m
Last active May 17, 2024 02:07
Zooms out a MKMapView to enclose all its annotations (inc. current location)
MKMapRect zoomRect = MKMapRectNull;
for (id <MKAnnotation> annotation in mapView.annotations) {
MKMapPoint annotationPoint = MKMapPointForCoordinate(annotation.coordinate);
MKMapRect pointRect = MKMapRectMake(annotationPoint.x, annotationPoint.y, 0, 0);
if (MKMapRectIsNull(zoomRect)) {
zoomRect = pointRect;
} else {
zoomRect = MKMapRectUnion(zoomRect, pointRect);
}
}
@rstacruz
rstacruz / index.md
Last active November 3, 2023 09:56
Rails models cheatsheet

Rails Models

Generating models

$ rails g model User

Associations

belongs_to

has_one

// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
var FORMAT_ONELINE = 'One-line';
var FORMAT_MULTILINE = 'Multi-line';
var FORMAT_PRETTY = 'Pretty';
var LANGUAGE_JS = 'JavaScript';
var LANGUAGE_PYTHON = 'Python';
// For example:
// UIColorFromRGBA(0xffee00, 0.5)
// UIColorFromRGB(0xffee00)
static inline UIColor *UIColorFromRGBA(int rgb, float a) {
return [UIColor colorWithRed:((float)((rgb & 0xFF0000) >> 16))/255.0
green:((float)((rgb & 0xFF00) >> 8))/255.0
blue:((float)(rgb & 0xFF))/255.0 alpha:a];
}
@danielcosta
danielcosta / integrating_jira_with_sourcetree.md
Last active November 7, 2023 21:03
Learn how to integrate your SourceTree repositories with JIRA

Integrating JIRA with SourceTree

Overview

You will learn how to link your JIRA tasks directly on SourceTree

Step by step

1. Setting

@peysal
peysal / introduction6.groovy
Created August 25, 2013 10:28
introduction to groovy 1) empty map 2) adding things to map 3) concat map to map 4) iterating
def emptyMap = [:]
assert emptyMap.size() == 0
def notEmptyMap = ["person1":"john", "person2":"mus"]
assert notEmptyMap.size() == 2
notEmptyMap.put "person3","test" //adding to existing one
assert notEmptyMap.size() == 3
notEmptyMap["person4"] = "beth"
assert notEmptyMap.size() == 4
@rxaviers
rxaviers / gist:7360908
Last active July 5, 2024 17:44
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@denji
denji / http-benchmark.md
Last active July 4, 2024 12:38
HTTP(S) Benchmark Tools / Toolkit for testing/debugging HTTP(S) and restAPI (RESTful)