Skip to content

Instantly share code, notes, and snippets.

View j8's full-sized avatar
💭
I may be slow to respond.

genie j8

💭
I may be slow to respond.
View GitHub Profile
@j8
j8 / disable all macos animations
Last active March 28, 2024 10:18
disable all macos animations for high performance
defaults write -g NSScrollViewRubberbanding -int 0
defaults write -g NSAutomaticWindowAnimationsEnabled -bool false
defaults write -g NSScrollAnimationEnabled -bool false
defaults write -g NSWindowResizeTime -float 0.001
defaults write -g QLPanelAnimationDuration -float 0
defaults write -g NSScrollViewRubberbanding -bool false
defaults write -g NSDocumentRevisionsWindowTransformAnimation -bool false
defaults write -g NSToolbarFullScreenAnimationDuration -float 0
defaults write -g NSBrowserColumnAnimationSpeedMultiplier -float 0
defaults write com.apple.dock autohide-time-modifier -float 0
@j8
j8 / git_empty_branch
Created February 14, 2014 08:32
Create new branch with empty folder structure
You can create a new empty branch like this:
$ git checkout --orphan NEWBRANCH
--orphan creates a new branch, but it starts without any commit. After running the above command you are on a new branch "NEWBRANCH", and the first commit you create from this state will start a new history without any ancestry.
The --orphan command keeps the index and the working tree files intact in order to make it convenient for creating a new history whose trees resemble the ones from the original branch.
Since you want to create a new empty branch that has nothing to do with the original branch, you can delete all files in the new working directory:
@j8
j8 / ubuntu_sublime_text_launcher.txt
Last active May 22, 2021 21:05
Sublime Text 3 Ubuntu Sidebar Icon Launcher
# Create new file trough vim in the following directory
sudo vim /usr/share/applications/sublime.desktop
#Put the following file contents and replace with the path to your Sublime Text
[Desktop Entry]
Version=1.0
Name=Sublime Text 2
# Only KDE 4 seems to use GenericName, so we reuse the KDE strings.
# From Ubuntu's language-pack-kde-XX-base packages, version 9.04-20090413.
GenericName=Text Editor
@j8
j8 / noproxy.py
Created April 15, 2020 13:01 — forked from nyov/noproxy.py
Test environment proxy settings
#!/usr/bin/env python
from __future__ import print_function
import sys, os
# This test should show how urllib.proxy_bypass_environment()
# doesn't handle proxy environment variables correctly
# on *NIX systems.
# (It does not understand IPs or CIDR notations.)
#
# For a possible solution see the `requests` library:
@j8
j8 / sketch-never-ending.md
Created December 1, 2017 09:10 — forked from Bhavdip/sketch-never-ending.md
Modify Sketch to never ending trial

###Sketch trial non stop

Open hosts files:

$ open /private/etc/hosts

Edit the file adding:

127.0.0.1 backend.bohemiancoding.com

127.0.0.1 bohemiancoding.sketch.analytics.s3-website-us-east-1.amazonaws.com

@j8
j8 / gist:dd6dd2b18229c20a29ee814605496001
Created September 30, 2016 16:11
jquery-anonymous func init
(function($){
})(jQuery)
@j8
j8 / less-reset
Last active September 29, 2016 20:57
less reset
/**
* Global Reset of all HTML Elements
*/
html, body {
border: 0;
font-family: "Helvetica-Neue", "Helvetica", Arial, sans-serif;
line-height: 1.5;
margin: 0;
padding: 0;
}
@j8
j8 / gist:4e96470619c1d842913234060499aefe
Created June 19, 2016 13:12
#Node.js interview questions
#
# Node.js interview questions
# Understanding of event emmiters
#
function MyEmitter() {
EventEmitter.call(this);
}
util.inherits(MyEmitter, EventEmitter);
@j8
j8 / gist:9ff43deeccf06b500dea617ee868c53f
Created June 1, 2016 13:09
Node.js interview question for process.nextTrick(fn);
'use strict'
var c=0;
function fn() {
  if(c++<100000000) {
console.log('done 2', c, process.memoryUsage().heapUsed)
   // return fn() // will crash
    return process.nextTick(fn); //works
}
@j8
j8 / Github push specific folder to gh-pags
Created January 26, 2016 09:31
Push the 'dist' folder to gh-pages without creating branch
git subtree push --prefix dist origin gh-pages
# where 'dist' is the name of the folder, it can be anything