This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// UIImage+ImmediateLoading.h | |
// Code taken from https://gist.github.com/259357 | |
// | |
#import <Foundation/Foundation.h> | |
@interface UIImage (UIImage_ImmediateLoading) | |
- (UIImage*) initImmediateLoadWithContentsOfFile:(NSString*)path; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Foo : IFoo | |
{ | |
string _applicationName; | |
string _currentUserName; | |
public Foo(string applicationName, string currentUserName) | |
{ | |
_applicationName = applicationName; | |
_currentUserName = currentUserName; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE DATABASE a_log_database; | |
USE a_log_database; | |
CREATE TABLE IF NOT EXISTS `log_table_name` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT, | |
`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | |
`priority` int(11) NOT NULL, | |
`priorityName` varchar(45) NOT NULL, | |
`message` varchar(255) NOT NULL, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install nodejs | |
$ brew install nodejs | |
# Install npm | |
$ curl http://npmjs.org/install.sh | sh | |
# If it does not work, try it | |
$ curl https://npmjs.org/install.sh | sh | |
# Still does not work? Try it |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function g:window_resize_mode() | |
echo 'window resize mode' | |
while 1 | |
let ch = getchar() | |
if ch == 104 " 104 = h | |
execute '2wincmd <' | |
elseif ch == 106 " 106 = j | |
execute "2wincmd -" | |
elseif ch == 107 " 107 = k |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <vector> | |
#include <string> | |
#include <sstream> | |
using namespace std; | |
int main(void) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"id": "dc85d388d79348808e01ddbc9bbd438a", | |
"name": "Default", | |
"buckets": [ | |
{ | |
"id": "be95f1d2ff284b9f8cb699bccf664e6b", | |
"can_be_empty": false, | |
"items": [ | |
{"required_content_type": "any"}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if( app.settings.env == 'production') { | |
console.log("Connecting to nodejitsu redis...") | |
// jitsu databases create redis rip | |
// jitsu databases list | |
var conn_url = 'redis://nodejitsu:09a5ecd07a2850a3d28f46894f8f5543@carp.redistogo.com:9552/'; | |
var rtg = url.parse(conn_url); | |
var db = redis.createClient(rtg.port, rtg.hostname); | |
var passwd = rtg.auth.split(':')[1]; | |
console.log("redis port:"+rtg.port+" hostname:"+rtg.hostname+" passwd:"+passwd); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND | |
root 1 0.0 0.1 23576 1668 ? Ss Sep11 0:00 init | |
root 1170 0.0 0.2 49424 2672 ? Ss Sep11 0:00 /usr/sbin/sshd -D | |
root 1188 0.0 0.1 18888 1016 ? Ss Sep11 0:00 cron | |
mysql 1192 0.0 2.7 189348 26336 ? Ssl Sep11 0:00 /usr/sbin/mysqld | |
syslog 1212 0.0 0.0 12536 800 ? Ss Sep11 0:00 /sbin/syslogd -u syslog | |
root 1249 0.0 1.0 202636 10136 ? Ss Sep11 0:00 /usr/sbin/apache2 -k start | |
www-data 1262 0.0 4.7 246760 44920 ? S Sep11 0:01 /usr/sbin/apache2 -k start | |
www-data 1263 0.0 4.8 247784 45804 ? S Sep11 0:02 /usr/sbin/apache2 -k start | |
www-data 1264 0.0 4.3 242664 41344 ? S Sep11 0:00 /usr/sbin/apache2 -k start |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait Functor[F[_]] { | |
def fmap[A, B](f: A => B): F[A] => F[B] | |
} |
NewerOlder