Skip to content

Instantly share code, notes, and snippets.

View nafeu's full-sized avatar
🕶️
In Virtual Reality

Nafeu Nasir nafeu

🕶️
In Virtual Reality
View GitHub Profile
@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@jaytaylor
jaytaylor / camel_case_to_snake_case.py
Created September 6, 2012 21:41
Convert camel-case to snake-case in python.
#!/usr/bin/env python
"""
Convert camel-case to snake-case in python.
e.g.: CamelCase -> snake_case
Relevant StackOverflow question: http://stackoverflow.com/a/1176023/293064
"""
@zenorocha
zenorocha / README.md
Last active May 28, 2024 08:23
A template for Github READMEs (Markdown) + Sublime Snippet

Project Name

TODO: Write a project description

Installation

TODO: Describe the installation process

Usage

@cobyism
cobyism / gh-pages-deploy.md
Last active May 25, 2024 08:30
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@alehandrof
alehandrof / Default.sublime-keymap
Last active October 3, 2017 16:13
Modal Navigation for: Sublime 3 w/ MultiBind & Colemak
// MultiBind
// Modal Navigation for Colemak -- inspired by [Miniguru](http://www.guru-board.com/english/layout_en)
{ "keys": ["alt+'"], "command": "multibind_toggle", "args" : { "layout": "modal-nav-colemak" } },
{ "keys": ["ctrl+shift+'"], "command": "multibind_show" },
{ "keys": ["escape"], "command": "multibind_toggle", "args" : { "layout": "default" }, "context": [ { "key": "multibind.modal-nav-colemak" } ] },
{ "keys": ["n"], "command": "move", "args": {"by": "characters", "forward": false}, "context": [ { "key": "multibind.modal-nav-colemak" } ] },
{ "keys": ["i"], "command": "move", "args": {"by": "characters", "forward": true}, "context": [ { "key": "multibind.modal-nav-colemak" } ] },
{ "keys": ["u"], "command": "move", "args": {"by": "lines", "forward": false}, "context": [ { "key": "multibind.modal-nav-colemak" } ] },
@kareemgrant
kareemgrant / gitignore.txt
Last active March 24, 2017 14:40
Common gitignore
# See http://help.github.com/ignore-files/ for more about ignoring files.
#
# If you find yourself ignoring temporary files generated by your text editor
# or operating system, you probably want to add a global ignore instead:
# git config --global core.excludesfile ~/.gitignore_global
*.rbc
*.sassc
.sass-cache
capybara-*.html
@EpokK
EpokK / ngEnter.js
Last active January 7, 2022 13:57
ngEnter directive if you can use submit form(https://twitter.com/ririlepanda)
app.directive('ngEnter', function() {
return function(scope, element, attrs) {
element.bind("keydown keypress", function(event) {
if(event.which === 13) {
scope.$apply(function(){
scope.$eval(attrs.ngEnter);
});
event.preventDefault();
}
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active May 28, 2024 07:00
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@sogko
sogko / app.js
Last active November 8, 2022 12:31
gulp + expressjs + nodemon + browser-sync
'use strict';
// simple express server
var express = require('express');
var app = express();
var router = express.Router();
app.use(express.static('public'));
app.get('/', function(req, res) {
res.sendfile('./public/index.html');
@ocello3
ocello3 / Metro.pde
Created January 13, 2016 21:09
Metronome class in processing (BPM, beat)
class Metro {
float bpm;
float nextTime = 0;
int mode = 0;
int modeNum;
Metro(float _bpm, int _modeNum) {
bpm = _bpm;
modeNum = _modeNum;
}