Skip to content

Instantly share code, notes, and snippets.

Avatar
🌝
Ba Dum Tsh!

Serkan Yerşen serkanyersen

🌝
Ba Dum Tsh!
View GitHub Profile
@alirobe
alirobe / reclaimWindows10.ps1
Last active Nov 27, 2022
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.…
View reclaimWindows10.ps1
##########
# Tweaked Win10 Initial Setup Script
# Primary Author: Disassembler <disassembler@dasm.cz>
# Modified by: alirobe <alirobe@alirobe.com> based on my personal preferences.
# Version: 2.20.2, 2018-09-14
# Primary Author Source: https://github.com/Disassembler0/Win10-Initial-Setup-Script
# Tweaked Source: https://gist.github.com/alirobe/7f3b34ad89a159e6daa1/
# Tweak difference:
#
# @alirobe's version is a subset focused on safely disabling telemetry, some 'smart' features and 3rd party bloat ...
@branneman
branneman / better-nodejs-require-paths.md
Last active Nov 13, 2022
Better local require() paths for Node.js
View better-nodejs-require-paths.md

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

@jlong
jlong / uri.js
Created Apr 20, 2012
URI Parsing with Javascript
View uri.js
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"
@coolaj86
coolaj86 / how-to-publish-to-npm.md
Last active Oct 14, 2022
How to publish packages to NPM
View how-to-publish-to-npm.md

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
View gist:527683
// ----------------------------------------------------------
// 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) {}
View 1-restify-server-cheatsheet.js
// 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');
@niftylettuce
niftylettuce / bootstrap-modal-responsive-fix.js
Created Aug 11, 2012
Twitter Bootstrap modal responsive fix by @niftylettuce
View bootstrap-modal-responsive-fix.js
// # Twitter Bootstrap modal responsive fix by @niftylettuce
// * resolves #407, #1017, #1339, #2130, #3361, #3362, #4283
// <https://github.com/twitter/bootstrap/issues/2130>
// * built-in support for fullscreen Bootstrap Image Gallery
// <https://github.com/blueimp/Bootstrap-Image-Gallery>
// **NOTE:** If you are using .modal-fullscreen, you will need
// to add the following CSS to `bootstrap-image-gallery.css`:
//
// @media (max-width: 480px) {
@serkanyersen
serkanyersen / User.sublime-keymap.json
Created Mar 26, 2012
sublime: windows/linux keymap
View User.sublime-keymap.json
[
/* 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
View User.sublime-keymap.json
[
/* 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"}},