Skip to content

Instantly share code, notes, and snippets.

AJ Alves zerokol

Block or report user

Report or block zerokol

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile

Electron SQLite3 Integration

When trying to use the node-sqlite3 module in Electron I got the error:

Error: Cannot find module '/path/to/my/application/node_modules/sqlite3/lib/binding/electron-v1.4-linux-x64/node_sqlite3.node'

Using Ubuntu 16.04 with Node 7.1.0 and Electron 1.4.12.

I read the following:

notsobad /
Created Aug 4, 2016
count 50x error in nginx error log
# By notsobad
if [ "$f" = "" ]; then
echo "Usage: $0 LOG_FILE" 1>&2
echo "like: $0 /var/log/nginx/"
echo "or: $0 /var/log/nginx/"
exit 1
View rspec_cheatsheet_controller_spec.rb
require 'rails_helper'
RSpec.describe TodosController, :type => :controller do
describe "GET #index" do
#describe "POST #create" do
#describe "GET #show" do
#describe "PATCH #update" do (or PUT #update)
#describe "DELETE #destroy" do
#describe "GET #new" do
doole /
Last active Mar 29, 2019
Install PostgreSQL PHP extensions on Mac OS X
# Install Xcode Command Line Tools first (required)
xcode-select --install
# Check PHP version `php --version`
PHP_VER=$(php -v | head -1 | awk '{ print $2 }')
# Extensions directory (default: empty string)
kristopherjohnson /
Created Nov 20, 2013
Bash script to set up ANDROID_SDK_ROOT and PATH for Android tools on Mac OS X with ADT bundle installed
# Setup for use of Android SDK tools from command line
# Set ANDROID_SDK_ROOT to point to the root of the SDK installation
export ANDROID_SDK_ROOT='/Applications/adt-bundle-mac-x86_64-20130729/sdk'
export PATH=$PATH:$ANDROID_SDK_ROOT/tools:$ANDROID_SDK_ROOT/platform-tools:$ANDROID_SDK_ROOT/tools/lib/x86_64
View Simple HTTP server in Ruby and Python
Simple Ruby Server:
# ruby -run -e httpd -- -p 5000 .
Simple Python Server:
# python -m SimpleHTTPServer
kyletcarlson / rspec_model_testing_template.rb
Last active Aug 16, 2019
Rails Rspec model testing skeleton & cheat sheet using rspec-rails, shoulda-matchers, shoulda-callbacks, and factory_girl_rails. Pretty much a brain dump of examples of what you can (should?) test in a model. Pick & choose what you like, and please let me know if there are any errors or new/changed features out there. Reddit comment thread: http…
View rspec_model_testing_template.rb
# This is a skeleton for testing models including examples of validations, callbacks,
# scopes, instance & class methods, associations, and more.
# Pick and choose what you want, as all models don't NEED to be tested at this depth.
# I'm always eager to hear new tips & suggestions as I'm still new to testing,
# so if you have any, please share!
# @kyletcarlson
# This skeleton also assumes you're using the following gems:
tedmiston / nodejs-tcp-example.js
Last active Aug 15, 2019
Node.js TCP client and server example
View nodejs-tcp-example.js
In the node.js intro tutorial (, they show a basic tcp
server, but for some reason omit a client connecting to it. I added an
example at the bottom.
Save the following server in example.js:
var net = require('net');
rgreenjr / postgres_queries_and_commands.sql
Last active Aug 17, 2019
Useful PostgreSQL Queries and Commands
View postgres_queries_and_commands.sql
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
shunchu / convert-seconds-into-hh-mm-ss-in-ruby.rb
Created Jul 25, 2012
Convert seconds into HH:MM:SS in Ruby
View convert-seconds-into-hh-mm-ss-in-ruby.rb
t = 236 # seconds"%H:%M:%S")
=> "00:03:56"
# Reference
You can’t perform that action at this time.