Skip to content

Instantly share code, notes, and snippets.

View adamatan's full-sized avatar

Adam Matan adamatan

View GitHub Profile
@widdowquinn
widdowquinn / github_pages_jekyll_minimal_mistakes.md
Created December 19, 2017 17:56
Create a Jekyll blog on GitHub Pages, using the Minimal-Mistakes Theme

Creating a Jekyll blog on GitHub Pages with Minimal-Mistakes

Setup

First, create a new Jekyll site and corresponding GitHub Pages repository, then test it locally at http://localhost:4000:

$ gem install jekyll bundler
$ jekyll new <REPO>/
Running bundle install in /Users/<USER>/Development/GitHub/<REPO>... 
@shospodarets
shospodarets / Chrome headless Puppeteer- capture DOM element screenshot using
Last active July 29, 2024 05:58
Chrome headless Puppeteer- capture DOM element screenshot using
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
// Adjustments particular to this page to ensure we hit desktop breakpoint.
page.setViewport({width: 1000, height: 600, deviceScaleFactor: 1});
await page.goto('https://www.chromestatus.com/samples', {waitUntil: 'networkidle'});
@ronreiter
ronreiter / longest.py
Created March 14, 2017 20:07
Longest word in Hebrew
a = open("/Users/Ron/words.txt").read().decode("utf8").split()
first_row = ["ק", "ר", "א", "ט", "ו", "ן", "ם", "פ"]
second_row = ["ש", "ד", "ג", "כ", "ע", "י", "ח", "ל", "ך", "ף"]
third_row = ["ז", "ס", "ב", "ה", "נ", "מ", "צ", "ת", "ץ"]
first_row = [x.decode("utf8") for x in first_row]
second_row = [x.decode("utf8") for x in second_row]
third_row = [x.decode("utf8") for x in third_row]
only_first = sorted([(len(x), x) for x in a if all(y in first_row for y in x)])
only_second = sorted([(len(x), x) for x in a if all(y in second_row for y in x)])
@danihodovic
danihodovic / main.tf
Created January 8, 2017 20:48
Terraform - static site using S3, Cloudfront and Route53
variable "aws_region" {
default = "eu-west-1"
}
variable "domain" {
default = "my_domain"
}
provider "aws" {
region = "${var.aws_region}"
@kracekumar
kracekumar / ws_app.py
Last active September 5, 2024 17:04
Simple websocket server with uvloop.
# -*- coding: utf-8 -*-
import asyncio
import uvloop
from aiohttp.web import Application, MsgType, WebSocketResponse
def add_socket(app, socket, user_id):
if user_id in app['connections']:
pass
@porjo
porjo / timelapse.md
Last active May 25, 2023 16:14
ffmpeg time-lapse

Convert sequence of JPEG images to MP4 video

Simple glob:

ffmpeg -r 24 -i '*.JPG' -s hd1080 -vcodec libx264 timelapse.mp4

Start from DSC_0079.JPG

ffmpeg -r 24 -f image2 -start_number 79 -i DSC_%04d.JPG -s hd1080 -vcodec libx264 timelapse2.mp4
@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a