Skip to content

Instantly share code, notes, and snippets.

View bookercodes's full-sized avatar

Alex Booker bookercodes

View GitHub Profile
function redirectToScreencast(req, res) {
// alias the params so they are more terse to reference
var screencastId = req.params.screencastId;
var remoteAddress = req.connection.remoteAddress;
var sql = squel.select()
.from('screencasts')
.where('screencastId = ?', screencastId)
.toString();
connection.queryAsync(sql).spread(function(screencasts) {
var screencast = screencasts.shift();
public void SayHi()
{
Console.WriteLine("Hi");
}
// versus.
public void SayHi() => Console.WriteLine("Hi");

Hello world

public string this[int index]
{
get { return ""; }
}
// versus.
public string this[int index] => "";
public override string ToString()
{
return "Hello";
}
// versus.
public override string ToString() => "Hello";
if executable('ag')
" Use Ag over Grep
autocmd VimEnter * set grepprg=ag\ --nogroup\ --nocolor
" Use ag in CtrlP for listing files. Lightning fast and respects .gitignore
unlet g:ctrlp_user_command
let g:ctrlp_user_command = 'ag %s -l --nocolor --hidden -g ""'
" ag is fast enough that CtrlP doesn't need to cache
let g:ctrlp_use_caching = 0
it ("should store user in the database", function(done) {
const model = {
username: "username",
email: "[email protected]",
password: "password123"
};
request(server.app)
.post("/users")
.send(model)
.expect(201)
  • Dunst
  • Nitrogen
  • Compton
  • GNOME Authentication Agent
  • lxpolkit
  • Alsamixer
  • Workspace back and forth
  • Clip it
  • Pacman Tray
  • Nm applet
hall
.create({
foo: 'bar'
bar: 'foo
})
.then(function(createdHall) {
const hallId = createdHall.dataValues.id;
return item.create({
hallId: hallId,
foo: 1