Skip to content

Instantly share code, notes, and snippets.

View Inza's full-sized avatar

Tomas Jukin Inza

View GitHub Profile
@mattmanning
mattmanning / gist:1430691
Created December 4, 2011 17:02
Fixing Apachebench on OS X Lion
If you're getting this error trying to use ApacheBench on OS X Lion:
Benchmarking mwmanning.com (be patient)...apr_socket_recv: Connection reset by peer (54)
You need to download the latest beta version of Apache and rebuild ab. Here's how (assuming you have homebrew installed).
brew install pcre
tar xzvf httpd-2.3.15-beta.tar.gz
cd httpd-2.3.15-beta
./configure
@PetrKaleta
PetrKaleta / gist:1527710
Created December 28, 2011 11:57
Simple OOP pattern
log = (o) -> console.log o
# -------------- CLASS DEFINITIONS -------------
# Private methods are starting with underscore, but this is just for better readability
class SimpleOOPPattern
@classProperty: 'le class property'
@classMethod: ->
'le class method'
publicProperty: 'le public property'
@PetrKaleta
PetrKaleta / Caffeinated.coffee
Created January 8, 2012 21:38
Micro JavaScript library written in CoffeeScript to solve my needs when creating mobile web apps for iOS.
###
Caffeinated.js 1.0.1
(c) 2012 Petr Kaleta, @petrkaleta
Caffeinated.js is freely distributable under the MIT license.
Micro JavaScript library written in CoffeeScript to make my life easier when creating mobile web apps for iOS.
I don't like extending built-in JavaScript objects, so I've created this lib as an separate object.
I used underscore identifier to make its calls short as possible. So please do not mess this lib with gorgeous
Underscore.js lib by Jeremy Ashkenas, DocumentCloud Inc.
Some methods are inspired or borrowed from popular JavaScript frameworks like jQuery, Underscore.js and Prototype.js
@chetan
chetan / yardoc_cheatsheet.md
Last active April 13, 2025 14:08
YARD cheatsheet
<!doctype html>
<!-- http://taylor.fausak.me/2015/01/27/ios-8-web-apps/ -->
<html>
<head>
<title>iOS 8 web app</title>
<!-- CONFIGURATION -->
@jc00ke
jc00ke / rails_admin_field_creator.rb
Created April 10, 2012 17:07 — forked from bbenezech/rails_admin_field_creator
Create a RailsAdmin custom field
say "Create stub for '#{field_name = name.sub('rails_admin_', '')}' in gem '#{name}'. This may take a while"
run "rm -rf script/ config/ lib/tasks/"
run "rm -rf app/assets app/controllers app/helpers app/mailers app/models"
run "mkdir -p app/views/rails_admin/main"
inside "app/views/rails_admin/main" do
create_file "_form_#{field_name}.html.haml", <<-END
= form.send field.view_helper, field.method_name, field._html_attributes
END
end
@kevinswiber
kevinswiber / hal.json
Created July 7, 2012 14:56
JSON Siren vs. HAL Representations
{
"_links": {
"self": { "href": "/orders" },
"next": { "href": "/orders?page=2" },
"find": { "href": "/orders{?id}", "templated": true }
},
"_embedded": {
"orders": [{
"_links": {
"self": { "href": "/orders/123" },
@mikeabdullah
mikeabdullah / KSPowerAssertion.h
Created August 4, 2012 15:13
KSPowerAssertion
//
// KSPowerAssertion.h
// Sandvox
//
// Created by Mike on 04/08/2012.
// Copyright (c) 2012 Karelia Software. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <IOKit/pwr_mgt/IOPMLib.h>
@rnapier
rnapier / fix-xcode
Last active October 31, 2024 13:54
Links Xcode SDKs from the /SDKs directory (which you maintain yourself)
#!/usr/bin/python
# fix-xcode
# Rob Napier <[email protected]>
# Script to link in all your old SDKs every time you upgrade Xcode
# Create a directory called /SDKs (or modify source_path).
# Under it, put all the platform directories:
# MacOSX.platform iPhoneOS.platform iPhoneSimulator.platform
# Under those, store the SDKs:
@oleganza
oleganza / gist:3404669
Created August 20, 2012 14:18
Modern Objective-C
// 2011:
[container setObject:value forKey:[NSString stringWithFormat:@"%d", number]];
// 2012:
container[@(number).stringValue] = value;