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
package main | |
import ( | |
"fmt" | |
"log" | |
"net/http" | |
"time" | |
) | |
// Example SSE server in Golang. |
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
require 'fog' | |
username = 'testuser' | |
bucket = 'uniquebucketname1234' | |
aws_credentials = { | |
:aws_access_key_id => 'YOUR-ACCESS-KEY-ID', | |
:aws_secret_access_key => 'YOUR-SECRET-ACCESS-KEY' | |
} |
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
package main | |
import ( | |
"fmt" | |
"log" | |
"net/http" | |
"time" | |
) | |
// Example SSE server in Golang. |
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
class AnonymousUser < User | |
attr_accessible *ACCESSIBLE_ATTRS, :type, :token, as: :registrant | |
def register(params) | |
params = params.merge(type: 'User', token: nil) | |
self.update_attributes(params, as: :registrant) | |
end | |
end |
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
'use strict'; | |
module.exports = function(grunt) { | |
// load all grunt tasks | |
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks); | |
// configurable paths | |
var paths = { |
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
require 'csv' | |
def memstats | |
size = `ps -o size= #{$$}`.strip.to_i | |
end | |
memstats #4900 | |
CSV.open('visitors.csv', headers: true) do |csv| | |
visitors = csv.each # Enumerator | |
memstats # 5164 |
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
#import <Foundation/Foundation.h> | |
// Xcode_3_2_6/usr/bin/gcc -arch ppc -std=c99 -isysroot /Xcode_3_2_6/SDKs/MacOSX10.5.sdk -g -Wall -framework Foundation -o endian-ppc ~/Downloads/endian.m (thanks to Jeremy W. Sherman for the assist) | |
// clang -arch x86_64 -g -Weverything -framework Foundation -o endian endian.m | |
int main (void) { | |
unsigned int values[] = { 1, 387, 8533937 }; |
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
<table> | |
<thead> | |
<tr> | |
<th>Name</th> | |
<th>Email></th> | |
<th>Country</th> | |
<th></th> | |
</tr> | |
</thead> | |
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
# Get the 1.0.1 version of SSL | |
brew install openssl | |
./configure --disable-hipe --enable-smp-support --enable-threads --enable-kernel-poll --enable-darwin-64bit --with-ssl=/usr/local/opt/openssl | |
touch lib/wx/SKIP lib/odbc/SKIP | |
make -j4 | |
sudo make install |
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
# 1) Create your private key (any password will do, we remove it below) | |
$ cd ~/.ssh | |
$ openssl genrsa -des3 -out server.orig.key 2048 | |
# 2) Remove the password | |
$ openssl rsa -in server.orig.key -out server.key |