Skip to content

Instantly share code, notes, and snippets.

View nkapliev's full-sized avatar
🎯
Focusing

Nick Kapliev nkapliev

🎯
Focusing
View GitHub Profile
@endolith
endolith / gcd_and_lcm.py
Last active June 22, 2022 23:33
GCD and LCM functions in Python for several numbers
# Greatest common divisor of 1 or more numbers.
from functools import reduce
def gcd(*numbers):
"""
Return the greatest common divisor of 1 or more integers
Examples
--------
@derekjw
derekjw / gist:1764249
Created February 8, 2012 01:51
Future flatMap example
class HttpClient {
def get(uri: URI): Future[String]
}
// return Future of next URI to get
def getUri(): Future[URI]
// return's available HttpClient from a pool
def getHttpClient(): Future[HttpClient]
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active April 25, 2024 06:23
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@ianmackinnon
ianmackinnon / match.c
Created August 8, 2012 12:01
C Regex multiple matches and groups example
# gcc -Wall -o match match.c && ./match
#
#include <stdio.h>
#include <string.h>
#include <regex.h>
@FGRibreau
FGRibreau / existsSync.js
Last active July 17, 2023 10:19
existsSync - Check if a file exist in NodeJS
/*
fileExistSync - Check if a file exist in NodeJS
Twitter: @FGRibreau / fgribreau.com
Usage:
var fileExistSync = require('./fileExistSync');
var exist = fileExistSync('/var/folders/zm/jmjb49l172g6g/T/65b199');
Support for Nodev0.6
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active April 19, 2024 11:00
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@jvns
jvns / Makefile
Created October 8, 2013 03:24
A simple kernel module that printk's "Hello, packet" when it intercepts a packet. Uses netfilter.
obj-m += hello-packet.o
all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
clean:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
@lsd
lsd / IdeaVim OS X Key Repeat.markdown
Last active December 12, 2023 18:09
Enable key-repeat for ALL applications or just for IdeaVim/specific JetBrains apps

Upgrading to Lion or Yosemite and WebStorm 9, I noticed key repeat was
turned off for the IdeaVim plugin h j k l keys.

System-wide key repeat

defaults write -g ApplePressAndHoldEnabled -bool false in a terminal will enable
key repeat for every app. This can alternatively be found in the accessibility settings in OS X' preferences.

App specific key repeat

@cvrebert
cvrebert / css_regression_testing.md
Last active May 9, 2023 12:13
Survey of screenshot-based CSS testing tools

Currently considering https://github.com/webdriverio/webdrivercss


Core Goals:

  • Can test in up-to-date versions of all major browsers
  • Can test on up-to-date versions of all major OSes
  • Can test in IE9 (because Bootstrap v4 will support IE9+)
  • Don't want to have to setup/maintain our own cluster of VMs running all the necessary OSes (and all the versions of Windows)
  • Workflow for management of reference/baseline/norm screenshots
@jacquerie
jacquerie / foobar.py
Last active October 28, 2023 16:09
How to decode the message at the end of Google Foobar
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import base64
MESSAGE = '''
EUYQGhMMSx0cU0FIU1MCFAQPG01NQ0gTAEICChUGBxZTRVxBSQoZFQYKHQpKSUNURhcVEgoUFR1I
SltDSBkBTRwKEAgQHxFCSkFJDgkJCgoGCkMLAQBGUklUQhMPAgAJCgYLV0MOSR0VAxAaABZBQVRP
TRICCRVIAk5IEg4dVFRfRkYZBgRARBI=
'''