Skip to content

Instantly share code, notes, and snippets.

View serkanyersen's full-sized avatar
🌝
Ba Dum Tsh!

Serkan Yerşen serkanyersen

🌝
Ba Dum Tsh!
View GitHub Profile
@serkanyersen
serkanyersen / User.sublime-keymap.json
Created March 26, 2012 18:33
sublime: os x keymap
[
/* Mac os x does not use home / end keys like windows. These keys fixes this behavior */
// Move selection to beggining of the line, windows style
{ "keys": ["shift+home"], "command": "move_to", "args": {"extend":true, "to": "bol"}},
// Move selection to end of the line, windows style
{ "keys": ["shift+end"], "command": "move_to", "args": {"extend":true, "to": "eol"}},
// Move cursor to beggining of the line, windows style
{ "keys": ["home"], "command": "move_to", "args": {"to": "bol"}},
// Move cursor to end of the line, windows style
{ "keys": ["end"], "command": "move_to", "args": {"to": "eol"}},
@serkanyersen
serkanyersen / User.sublime-keymap.json
Created March 26, 2012 18:37
sublime: windows/linux keymap
[
/* Eclipse keys */
// Go to anything menu
{ "keys": ["ctrl+t"], "command": "show_overlay", "args": {"overlay": "goto", "show_files": true} },
// Shift+Enter to add a new line without going to end of the line
{ "keys": ["shift+enter"], "command": "run_macro_file", "args": {"file": "Packages/Default/Add Line.sublime-macro"} },
// Move lines up and down
{ "keys": ["alt+up"], "command": "swap_line_up" },
{ "keys": ["alt+down"], "command": "swap_line_down" },
// Close all tabs without closing sublime
// Restify Server CheatSheet.
// More about the API: http://mcavage.me/node-restify/#server-api
// Install restify with npm install restify
// 1.1. Creating a Server.
// http://mcavage.me/node-restify/#Creating-a-Server
var restify = require('restify');
@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"
@branneman
branneman / better-nodejs-require-paths.md
Last active January 30, 2024 04:32
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

const Article = require('../../../../app/models/article');

Those suck for maintenance and they're ugly.

Possible solutions

@coolaj86
coolaj86 / how-to-publish-to-npm.md
Last active February 20, 2024 11:43
How to publish packages to NPM

Getting Started with NPM (as a developer)

As easy as 1, 2, 3!

Updated:

  • Aug, 08, 2022 update config docs for npm 8+
  • Jul 27, 2021 add private scopes
  • Jul 22, 2021 add dist tags
  • Jun 20, 2021 update for --access=public
  • Sep 07, 2020 update docs for npm version
// ----------------------------------------------------------
// A short snippet for detecting versions of IE in JavaScript
// without resorting to user-agent sniffing
// ----------------------------------------------------------
// If you're not in IE (or IE version is less than 5) then:
// ie === undefined
// If you're in IE (>=5) then you can determine which version:
// ie === 7; // IE7
// Thus, to detect IE:
// if (ie) {}
@alirobe
alirobe / reclaimWindows10.ps1
Last active March 28, 2024 12:31
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
###
###
### UPDATE: For Win 11, I recommend using this tool in place of this script:
### https://christitus.com/windows-tool/
### https://github.com/ChrisTitusTech/winutil
### https://www.youtube.com/watch?v=6UQZ5oQg8XA
### iwr -useb https://christitus.com/win | iex
###
###