This file contains 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
/* | |
Node.js, express, oauth example using Twitters API | |
Install Node.js: | |
curl -0 http://nodejs.org/dist/v0.6.11/node-v0.6.11.tar.gz | |
tar -zxf node-v0.6.11.tar.gz | |
cd node-v0.6.11 | |
./configure | |
make | |
make install |
This file contains 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" | |
"sort" | |
"time" | |
) | |
type User struct{ | |
Name string | |
Email string | |
age int |
This file contains 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
func Reverse(s string) string { | |
runes := []rune(s) | |
for i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 { | |
runes[i], runes[j] = runes[j], runes[i] | |
} | |
return string(runes) | |
} |
This file contains 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
def getDayName(day) | |
dayName = "" | |
case day | |
when "Mon" | |
dayName = "Monday" | |
when "Tue" | |
dayName = "Tuesday" | |
when "Wed" | |
dayName = "Wednesday" | |
when "Thu" |
This file contains 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
fn main(){ | |
println!("Hello from print.rs"); | |
println!( | |
"{0} is from {1} and {0} likes to {2}", | |
"Nicholas", | |
"Stockholm", | |
"code" | |
); | |
println!( | |
"{name} likes to play {game}", |
This file contains 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
def pow (baseNum, powNum) | |
result = 1 | |
powNum.times do |index| | |
result = result * baseNum | |
end | |
return result | |
end | |
puts pow(2,3) |
This file contains 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
using System; | |
class MainClass | |
{ | |
static void Main (string[] args) | |
{ | |
string secretWord = "Nicholas"; | |
string guess = ""; | |
int guesscount = 0; | |
while(guess != secretWord){ |
This file contains 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
beforeEach(async(() => { | |
TestBed.configureTestingModule({ | |
imports: [ | |
MdToolbarModule, | |
], | |
providers: [ | |
{ | |
provide: Router, | |
useClass: MockRouter, | |
}, |
This file contains 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
====================================== | |
Usage: | |
Fetcher<Source, MyEntity> f = new Fetcher<Source, MyEntity>(source) { | |
@Override | |
public List<MyEntity> fetch(Pageable pageRequest) | |
{ | |
return source.findAll(pageRequest); | |
} | |
}; |
This file contains 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
--------------------------------------------------------- | |
-- Boilerplate mocking out what we already have today. -- | |
-- Just scroll down to the bottom. -- | |
--------------------------------------------------------- | |
-- Cleanup | |
drop table if exists | |
import_log, | |
my_data_source, | |
meta_record, |
NewerOlder