Skip to content

Instantly share code, notes, and snippets.

@spint
spint / disable-back-swipe.js
Created November 15, 2013 09:31
Disabling back history navigation with swipe (chrome)
// http://stackoverflow.com/questions/15829172/stop-chrome-back-forward-two-finger-swipe
$(document).on('mousewheel', function(e) {
var $target = $(e.target).closest('.scrollable-h');
if ($target.scrollLeft () <= 4) {
$target.scrollLeft(5);
return false;
}
});
@sangeeths
sangeeths / github-to-bitbucket
Created March 10, 2014 15:24
Forking a Github repo to Bitbucket
Go to Bitbucket and create a new repository (its better to have an empty repo)
git clone [email protected]:abc/myforkedrepo.git
cd myforkedrepo
Now add Github repo as a new remote in Bitbucket called "sync"
git remote add sync [email protected]:def/originalrepo.git
Verify what are the remotes currently being setup for "myforkedrepo". This following command should show "fetch" and "push" for two remotes i.e. "origin" and "sync"
git remote -v
@ahmohamed
ahmohamed / README.md
Last active January 31, 2023 23:26 — forked from mbostock/.block
D3.js: Panning with mouse wheel

This example demonstrate how to remap D3 events. MouseWheel event is used to pan the chart in x and y directions. This example was created as an answer to this SO question (Refer to it for detailed explanation).

@c-kick
c-kick / hnl.mobileConsole.js
Last active March 18, 2025 22:30
NOTE: V2 Released! Seehttps://github.com/c-kick/mobileConsole hnl.mobileConsole.js - extends JavaScript's console to display a visual console inside the webpage. Very usefull for debugging JS on mobile devices with no real console. Info and demo: http://www.hnldesign.nl/work/code/mobileconsole-javascript-console-for-mobile-devices/
/*!
*
* NEW VERSION AT https://github.com/c-kick/mobileConsole
*
* hnl.mobileConsole - javascript mobile console - v1.3.8 - 04/01/2021
* Adds html console to webpage. Especially useful for debugging JS on mobile devices.
* Supports 'log', 'trace', 'info', 'warn', 'error', 'group', 'groupEnd', 'table', 'assert', 'clear'
* Inspired by code by Jakub Fiala (https://gist.github.com/jakubfiala/8fe3461ab6508f46003d)
* Licensed under the MIT license
*
@hectorm
hectorm / README.md
Created May 7, 2017 20:47 — forked from jm3/README.md
Cognitive Bias Codex
@nazrdogan
nazrdogan / axios.js
Created July 7, 2017 13:08
Axios- 401 Re Login
// Add a request interceptor
axios.interceptors.request.use(function (config) {
// Do something before request is sent
return config;
}, function (error) {
// Do something with request error
return Promise.reject(error);
});
// Add a response interceptor
@adrobinoga
adrobinoga / multiple_realtime.py
Last active January 2, 2025 15:38
test script to read realtime events from multiple zkteco devices
import time
import datetime
from utils import *
import pyzk.pyzk as pyzk
from pyzk.zkmodules.defs import *
from pyzk.misc import *
"""
Script to connect to multiple ZKTeco devices and check the incoming events by pooling.
import sys
import gi
gi.require_version('Gst', '1.0')
gi.require_version('GstNet', '1.0')
from gi.repository import Gst, GstNet
ptp_domain = 0
ptp_interfaces = ['enp0s25']
@larshb
larshb / arpscan.py
Last active July 20, 2023 19:36
ARP-scan for Windows
import re
from subprocess import CalledProcessError, check_output as echo
from sys import platform
from socket import gethostbyaddr
# Config
IGNORE_BROADCAST = True
LOOKUP_HOSTNAMES = True
def get_host(ip):
@philhartung
philhartung / ptp.py
Last active July 25, 2024 14:56
Sync to PTPv2 clock and send RTP according to AES67. SAP/SDP not implemented here.
import sys
import gi
gi.require_version('Gst', '1.0')
gi.require_version('GstNet', '1.0')
from gi.repository import Gst, GstNet, GObject, GLib
Gst.init([])
mainloop = GLib.MainLoop()