Skip to content

Instantly share code, notes, and snippets.

View v3rse's full-sized avatar
💭
Reshaping the un1v3rse

Nana Ofosuhene Adane v3rse

💭
Reshaping the un1v3rse
View GitHub Profile
@v3rse
v3rse / load_nvm.fish
Last active April 3, 2024 04:59
A faster NVM shell integration for Fish shell. No need for bass (DEPENDENCIES: https://github.com/jorgebucaran/nvm.fish)
# loader functions. place this in your fish functions directory. call it in your config.fish file
function load_nvm --on-variable="PWD"
set -l default_node_version "system"
set -l node_version (nvm current)
set -l nvmrc_path (nvm_find_nvmrc)
if test -n "$nvmrc_path"
set -l nvmrc_node_version (nvm_find_nvmrc_version)
if test "$nvmrc_node_version" != "$node_version"
set -l use_status (nvm use $nvmrc_node_version 2>&1)
@v3rse
v3rse / config
Created November 8, 2016 15:40
i3 configuration
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout some time, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
@v3rse
v3rse / dbservertofile.js
Created October 11, 2016 03:09
A simple json file based database server
var http = require('http');
var url = require('url');
var fs = require('fs');
var DB_FILE = 'database.json';
function init(){
//create file if it's present.
//synchronous because it needs to happen before requests can be processed
if(!fs.existsSync(DB_FILE)){
console.log(`Initialising storage.\n -Creating ${DB_FILE} file`);
@v3rse
v3rse / server.js
Created October 7, 2016 07:10
A simple in-memory database
var http = require('http');
var url = require('url');
var data = {};
http.createServer(function(req, res){
//use querystring module on query strings and stores in 'query' object
var parseUrl = url.parse(req.url, true, true);
var statusCode = 404;
var content = "404 - Not Found"
@v3rse
v3rse / done.js
Last active February 1, 2023 18:16
A simple command line todo list app written using Node.js. Run using `node ./done.js` or create an alias `alias done=node ./done.js`
//This is a simple command line todo list app
//Features
//-create todo item
//-list todo item
//-check todo item off list
//-delete todo item
var fs = require('fs');
@v3rse
v3rse / the-way-of-the-substack.md
Created July 13, 2016 01:51
The way of the substack

The way of the substack

With over 200 modules in npm, and many such as browserify, dnode, optimist, etc. relied upon day-to-day by developers all around the world, substack is a pretty damn productive guy.

Plus, he's got an awesome philosophy on programming to boot (yes, there is a programming philosophy! ... no comprende? Let me explain later).

BTW, how do I know this? I got to talk to him at campjs as he wrote & published a module (lexical-scope to be exact). He was super friendly and shared alot of his thoughts on many topics.

All in all, it was really cool to meet someone that's completely congruent with what he says & lives out as a programmer. It almost felt Bret Victor-like.

@v3rse
v3rse / git-cheat-sheet.md
Created April 20, 2016 15:21 — forked from juristr/git-cheat-sheet.md
My Git cheat sheet

Git Cheat Sheet

Committing and Undoing

Adding file for committing

$ git add <filename>
// Node.js CheatSheet.
// Download the Node.js source code or a pre-built installer for your platform, and start developing today.
// Download: http://nodejs.org/download/
// More: http://nodejs.org/api/all.html
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html
@v3rse
v3rse / rails_resources.md
Last active August 29, 2015 14:08 — forked from jookyboi/rails_resources.md
Rails-related Gems and guides to accelerate your web project.

Gems

  • Bundler - Bundler maintains a consistent environment for ruby applications. It tracks an application's code and the rubygems it needs to run, so that an application will always have the exact gems (and versions) that it needs to run.
  • rabl - General ruby templating with json, bson, xml, plist and msgpack support
  • Thin - Very fast and lightweight Ruby web server
  • Unicorn - Unicorn is an HTTP server for Rack applications designed to only serve fast clients on low-latency, high-bandwidth connections and take advantage of features in Unix/Unix-like kernels.
  • SimpleCov - SimpleCov is a code coverage analysis tool for Ruby 1.9.
  • Zeus - Zeus preloads your Rails app so that your normal development tasks such as console, server, generate, and specs/tests take less than one second.
  • [factory_girl](h
@v3rse
v3rse / javascript_resources.md
Last active August 29, 2015 14:08 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage