Skip to content

Instantly share code, notes, and snippets.

View CalvinRodo's full-sized avatar

Calvin Rodo CalvinRodo

View GitHub Profile

Keybase proof

I hereby claim:

  • I am calvinrodo on github.
  • I am calvinrodo (https://keybase.io/calvinrodo) on keybase.
  • I have a public key ASCsqjFrNn8HNvXFJ8HHEfpvJDpjCjK1qfytbv0nQmGnfgo

To claim this, I am signing this object:

@CalvinRodo
CalvinRodo / .xprofile
Created August 9, 2018 12:38
xprofile setting for ubuntu at TDLC
#!/bin/sh
xrandr --newmode "1920x1080_60.00" 173.00 1920 2048 2248 2576 1080 1083 1088 1120-hsync +vsync
xrandr --addmode DP-2 1920x1080_60.00
@CalvinRodo
CalvinRodo / gist:d7db07a2668eb4039f88
Created May 11, 2015 15:42
rewrite assignments.vb
Imports System.Text
Public Class Assignments
'this object will perform our database interaction
Private ReadOnly _sqlbot As New SQLBot
'this will hold our tickets
@CalvinRodo
CalvinRodo / 0_reuse_code.js
Last active August 29, 2015 14:10
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
AddRow("1",17)
AddRow("2",18)
AddRow("1",17)
AddRow("2", 18)
AddRow("3", 19)
AddRow("4", 20)
AddRow("5", 21)
AddRow("6", 22)
Public Function IsCorrectCheck(controlID As String, answerid As String) As Boolean
Dim answers() As String = Split(answerid, ",")
return answers.Any(Function(obj) IsCorrectSingleCheck(controlId, obj)
End Function
function bool test1(){
Console.WriteLine("Test 1");
return false;
}
function bool test2(){
Console.WriteLine("Test 2");
return false;
}
description "Upstart script to run a nodejs app as a service"
author "Louis Chatriot"
env NODE_BIN=/usr/local/bin/node
env APP_DIR=/path/to/app/dir
env SCRIPT_FILE="scriptfile.js" # Entry point for the nodejs app
env LOG_FILE=/path/to/logfile.log
env RUN_AS="anyuser" # Upstart can only be run nicely as root, need to drop privileges
env SERVER_ENV="anything" # Usual apps can be run in different environments (development, test, production ...)
# I typically use the environment variable NODE_ENV (see below)
# Ubuntu upstart file at /etc/init/mongodb.conf
pre-start script
mkdir -p /var/lib/mongodb/
mkdir -p /var/log/mongodb/
end script
start on runlevel [2345]
stop on runlevel [06]
@CalvinRodo
CalvinRodo / db.js
Created February 3, 2013 13:48
Parent object
var DB = function DB() {
}
DB.prototype = {
ConnectToDb: function () {
var mongoDb = require('mongoskin'),
settings = require('../express_settings.js');
return mongoDb.db(settings.Config.MongoDbConnection);
}
}