Skip to content

Instantly share code, notes, and snippets.

View jansowinski's full-sized avatar

Jan Sowinski jansowinski

View GitHub Profile
@gullyn
gullyn / flappy.html
Last active May 4, 2024 15:35
Flappy bird in 205 bytes (improved!)
<body onload=z=c.getContext`2d`,setInterval(`c.width=W=150,Y<W&&P<Y&Y<P+E|9<p?z.fillText(S++${Y=`,9,9|z.fillRect(p`}*0,Y-=--M${Y+Y},P+E,9,W),P))):p=M=Y=S=6,p=p-6||(P=S%E,W)`,E=49) onclick=M=9><canvas id=c>
@cdgriffith
cdgriffith / .pythonrc.py
Last active November 21, 2020 04:56
Python RC file
# In .bashrc and .profile
# export PYTHONSTARTUP="$HOME/.pythonrc.py"
# pip install python-box reusables pdir2
from __future__ import print_function, with_statement, absolute_import
try:
from box import Box, BoxList
except ImportError:
print("Box not available")
@petersuhm
petersuhm / docker-compose.yml
Created February 20, 2017 20:51
Docker Compose file for WP Pusher
version: '2'
services:
db:
image: mysql:5.7
volumes:
- wp_pusher_db_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: wordpress
@turtlemonvh
turtlemonvh / Makefile
Last active January 23, 2024 03:33
Golang Project Makefile Template
# Borrowed from:
# https://github.com/silven/go-example/blob/master/Makefile
# https://vic.demuzere.be/articles/golang-makefile-crosscompile/
BINARY = superdo
VET_REPORT = vet.report
TEST_REPORT = tests.xml
GOARCH = amd64
VERSION?=?
@marshyski
marshyski / luajit-luarocks-osx.sh
Last active March 20, 2019 21:31
LuaJIT and luarocks on Mac OS X El Capitan
# This is to install both on OS X if you don't want to use homebrew
# xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
xcode-select --install
curl -O http://luajit.org/download/LuaJIT-2.0.4.zip
unzip LuaJIT-2.0.4.zip
cd LuaJIT-2.0.4
make && make install
curl -O http://keplerproject.github.io/luarocks/releases/luarocks-2.3.0.tar.gz
@Uchean
Uchean / clamav-mac.md
Created December 9, 2015 23:36
Get ClamAV running on Mac OS X (using Homebrew)

Get ClamAV running on Mac OS X (using Homebrew)

The easiest way to get the ClamAV package is using Homebrew

$ brew install clamav

Before trying to start the clamd process, you'll need a copy of the ClamAV databases.

Create a freshclam.conf file and configure as so

@msrose
msrose / combining-git-repositories.md
Last active May 8, 2024 22:35
How to combine two git repositories.

Combining two git repositories

Use case: You have repository A with remote location rA, and repository B (which may or may not have remote location rB). You want to do one of two things:

  • preserve all commits of both repositories, but replace everything from A with the contents of B, and use rA as your remote location
  • actually combine the two repositories, as if they are two branches that you want to merge, using rA as the remote location

NB: Check out git subtree/git submodule and this Stack Overflow question before going through the steps below. This gist is just a record of how I solved this problem on my own one day.

Before starting, make sure your local and remote repositories are up-to-date with all changes you need. The following steps use the general idea of changing the remote origin and renaming the local master branch of one of the repos in order to combine the two master branches.

/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
@staltz
staltz / introrx.md
Last active May 10, 2024 12:08
The introduction to Reactive Programming you've been missing
@eyecatchup
eyecatchup / prettyCss.sh
Created October 13, 2013 05:29
Bash script to "pretty-print" minified CSS.
#!/bin/bash
#Author: Stephan Schmitz, https://github.com/eyecatchup, <eyecatchup@gmail.com>
#Based on work by: Michael Bianco, http://developer.mabwebdesign.com/, <software@mabwebdesign.com>
#Description: Bash script to create a pretty-printed version of a minified CSS file.
# Note: Requires GNU sed. See: http://www.gnu.org/software/sed//sed.html
#Usage: prettyCss.sh inputfile [outputfile]
# If [outputfile] is not given, pretty-printed CSS will be send to stdout.
SED_COMMAND=/bin/sed # NOTE: Change the SED_COMMAND variable value to the path to your GNU sed!