This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# source: http://st-on-it.blogspot.com/2010/01/how-to-move-folders-between-git.html | |
# First of all you need to have a clean clone of the source repository so we didn't screw the things up. | |
git clone git://server.com/my-repo1.git | |
# After that you need to do some preparations on the source repository, nuking all the entries except the folder you need to move. Use the following command | |
git filter-branch --subdirectory-filter your_dir -- -- all | |
# This will nuke all the other entries and their history, creating a clean git repository that contains only data and history from the directory you need. If you need to move several folders, you have to collect them in a single directory using the git mv command. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Instructions: | |
- Download and unzip Mojave dynamic background here: https://files.rb.gd/mojave_dynamic.zip | |
- Rename the extracted folder as "mojave-background" (Excuse the trouble but I renamed it on my machine and already use that path in the XML file) | |
- Save this xml file next to the Mojave background files | |
- Fix the path to the background images below (better using absolute path) | |
- Lastly, either: | |
+ GNOME: Use gnome-tweaks tool to select this XML as wallpaper (as default wallpaper settings won't let you choose wallpaper from custom path) | |
+ MATE: Go to background setting (in Appearance) > Choose +Add... > make sure **All files** filter is selected at the bottom right > Then choose mojave.xml | |
--> | |
<background> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Refer: http://www.linuxfoundation.org/collaborate/workgroups/networking/netem#Delaying_only_some_traffic | |
#Refer: http://www.bomisofmab.com/blog/?p=100 | |
#Refer: http://drija.com/linux/41983/simulating-a-low-bandwidth-high-latency-network-connection-on-linux/ | |
#Setup the rate control and delay | |
sudo tc qdisc add dev lo root handle 1: htb default 12 | |
sudo tc class add dev lo parent 1:1 classid 1:12 htb rate 56kbps ceil 128kbps | |
sudo tc qdisc add dev lo parent 1:12 netem delay 200ms | |
#Remove the rate control/delay | |
sudo tc qdisc del dev lo root |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For Ubuntu MATE, save this config file at ~/.config/marco-compton.conf | |
################################# | |
# | |
# Backend | |
# | |
################################# | |
# Backend to use: "xrender" or "glx". | |
# GLX backend is typically much faster but depends on a sane driver. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Realistic CSS3 Waterfall | |
* Author: Thanh Tran | |
* License: MIT | |
* Tutorial: http://blog.int3ractive.com/2012/04/tutorial-realistic-waterfall-with-css3.html | |
* Image courtesy: http://wolffanticy.webs.com/waterfallcavepack.htm | |
*/ | |
/* Container with the static waterfall background image */ | |
.waterfall { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var | |
projector = new THREE.Projector(), | |
p3D = new THREE.Vector3(25, 15, 9), | |
p2D; | |
p2D = projector.projectVector(p3D, camera); | |
p3D = projector.unprojectVector(p2D, camera); | |
//need extra steps to convert p2D to window's coordinates | |
p2D.x = (p2D.x + 1)/2 * window.innerWidth; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Apply custom color theme for Pantheon Terminal ver 5.3+ | |
# 1) preview and choose a color theme from http://mayccoll.github.io/Gogh/ | |
# 2) open the equivalent bash file containing the color values at https://github.com/Mayccoll/Gogh/tree/master/themes | |
# 3) concatenate all 16 colors at the top with colon ":", then replace it at the palette variable below | |
# 4) replace color for foreground, background, and cursor; choose whether your theme is light or dark | |
# 5) sudo apt-get install dconf-tools | |
# 6) execute this script |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# NOTE: The commands here only applicable for Ubuntu 16.04 Xenial, do not use it for other distros | |
# Update server to latest packages | |
sudo apt update && sudo apt upgrade -y | |
# Install nginx and git | |
sudo apt install -y nginx git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// stylelint-disable | |
.highlight pre { color:#cdd3de; background-color: #142026; } | |
.highlight .hll { background-color: #142026; } | |
.highlight .c { color: #65737e; font-style: italic; } /* Comment */ | |
.highlight .err { color: #ec5f67; background-color: #1e0010 } /* Error */ | |
.highlight .k { color: #c594c5 } /* Keyword */ | |
.highlight .l { color: #f99157 } /* Literal */ | |
.highlight .n { color: #f07178 } /* Name */ | |
.highlight .o { color: #5fb3b3 } /* Operator */ | |
.highlight .p { color: #6699cc } /* Punctuation */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Client-side GraphQL data fetch example with HTML5 Fetch API | |
* | |
* @param {String} url URL to the GraphQL endpoint | |
* @param {String} query The GraphQL query | |
* @return {Promise} the request resolving promise object | |
*/ | |
function fetchData(url = 'http://localhost:3000/graphql', query = '{ hello }') { //eslint-disable-line no-unused-vars | |
let requiredHeaders = new Headers({ | |
'Content-Type': 'application/json', |
NewerOlder