Skip to content

Instantly share code, notes, and snippets.

@fanian
fanian / Sync gh-pages + master branches
Created Feb 11, 2019 — forked from mandiwise/Sync gh-pages + master branches
Keep gh-pages up to date with a master branch
View Sync gh-pages + master branches
// Reference: http://lea.verou.me/2011/10/easily-keep-gh-pages-in-sync-with-master/
$ git add .
$ git status // to see what changes are going to be commited
$ git commit -m 'Some descriptive commit message'
$ git push origin master
$ git checkout gh-pages // go to the gh-pages branch
$ git rebase master // bring gh-pages up to date with master
$ git push origin gh-pages // commit the changes
@fanian
fanian / taxiCalculator.py
Created Nov 30, 2017
POST from python and nested loop
View taxiCalculator.py
import requests, json
open('output.txt', 'w').close()
with open('towns.txt') as f:
lines = f.readlines()
length = len(lines)
i = 0
while i < length:
for j in range(i, length):
begin = lines[i].strip('\n')
end = lines[j].strip('\n')
@fanian
fanian / remove_crw.cmd
Last active Mar 22, 2016 — forked from xvitaly/remove_crw.cmd
Remove telemetry updates for Windows 7 and 8.1
View remove_crw.cmd
@ECHO OFF
REM #
REM # [EN] Remove telemetry updates for Windows 7 and 8.1
REM #
REM # Sources :
REM # https://gist.github.com/xvitaly/eafa75ed2cb79b3bd4e9#file-remove_crw-cmd
REM #
echo Uninstalling KB3075249 (telemetry for Win7/8.1)
start /w wusa.exe /uninstall /kb:3075249 /quiet /norestart
echo Uninstalling KB3080149 (telemetry for Win7/8.1)
@fanian
fanian / mikrotik 2 gateways and separate clients
Last active Apr 5, 2020
mikrotik 2 gateways and separate clients
View mikrotik 2 gateways and separate clients
How to add 2 gateways and seperate clients by Chupaka
/ip firewall mangle add chain=prerouting src-address=198.54.15.0/24 action=mark-routing new-routing-mark=r_178
/ip firewall mangle add chain=prerouting src-address=192.168.10.0/24 action=mark-routing new-routing-mark=r_178
/ip firewall mangle add chain=prerouting src-address=192.168.11.0/24 action=mark-routing new-routing-mark=r_172
/ip firewall mangle add chain=prerouting src-address=192.168.12.0/24 action=mark-routing new-routing-mark=r_172
/ip route add gateway=178.242.0.200 routing-mark=r_178
/ip route add gateway=172.16.0.200 routing-mark=r_172
@fanian
fanian / bootstrap carousel height
Created Nov 25, 2014
Normalize Carousel Heights - pass in Bootstrap Carousel items
View bootstrap carousel height
@fanian
fanian / cycleSliderItemCss
Created Oct 2, 2014
add css class to cycle slider item, when clicking
View cycleSliderItemCss
//add css class to cycle slider item, when clicking
jQuery(document).ready(function($){
$('.slider .cycle-slide').click(function(){
var index = $('.slider').data('cycle.API').getSlideIndex(this);
$('.cycle-slide-active').removeClass('cycle-slide-active');
$(this).addClass('cycle-slide-active');
});
});
View counter
function counter() {
var stepCount = 20;
var time = 2000;
var stepTime = time / stepCount;
var count1 = $('#count_1').text();
var count2 = $('#count_2').text();
var count3 = $('#count_3').text();
var count4 = $('#count_4').text();
var count5 = $('#count_5').text();
View scroll
//fix menu
$(window).scroll(function(){
var js_scroll = $(window).scrollTop();
var SCROLL_MIN = 820;
var SCROLL_MAX = 5480;
if ( js_scroll > SCROLL_MIN ) {
$(".js-top-nav").addClass('fixed');
if(js_scroll > SCROLL_MAX) {
$(".js-top-nav").removeClass('fixed');
};
You can’t perform that action at this time.