Skip to content

Instantly share code, notes, and snippets.

@igrigorik
igrigorik / load.rb
Created April 20, 2012 06:34
load githubarchive data into sqlite3 database
#
# $> ruby load.rb http://data.githubarchive.org/2012-04-01-15.json.gz
#
require 'yajl'
require 'zlib'
require 'sqlite3'
require 'open-uri'
input = ARGV.shift
@ojii
ojii / set-me-up.py
Created October 17, 2012 16:49
setup py generator
# -*- coding: utf-8 -*-
import re
import distutils.sysconfig as sysconfig
import os
__doc__ = '''set-me-up.
Usage:
set-me-up <projectdir>
'''
@Hiradur
Hiradur / glshim.sh
Last active September 12, 2021 07:56
Shell sript to build glshim and and run games with it on Raspberry Pi
#!/bin/sh
# Original author: Hiradur
# License: CC0
# Purpose: Build and update glshim, glues and TinyGLES, set up correct paths for programs
set -eu # stop script on errors
GLWRAPPER_INSTALL_DIR=~/glwrapper # source code and binary files will be placed here
# if no arguments are given
# download/update glshim, glues and tinygles code and compile
@qubodup
qubodup / arrow-key-to-touch-main.lua
Created December 14, 2016 17:21
LOVE2D Touchscreen Arrow Key Area Buttons Implementation (CC0) Video tutorial: https://youtu.be/sArl6wypDfY
-- code by Iwan 'qubodup' Gabovitch
-- licesnse/terms: public domain (cc0)
-- meaning do what you want, no credit needed, you can delete this text too
-- video tutorial: https://youtu.be/sArl6wypDfY
-- you can make a bee.png from https://openclipart.org/detail/215877/cartoon-bee
function love.load()
gw = love.graphics.getWidth() -- game width
gwp = gw/10 -- game widht "part"
@bep
bep / hugo-on-android.md
Last active July 6, 2024 16:46
Run Hugo on an Android phone

First install Termux

Then there are two options:

Build from source

Open the Termux terminal on your Android device and copy-and-paste the commands listed below and hit ENTER:

@DD3Boh
DD3Boh / gist:6c51fd3c5f91b1042e956771483714de
Created July 19, 2017 14:59
How to merge a newer CAF tag in an android kernel
First go here:
https://wiki.codeaurora.org/xwiki/bin/QAEP/release
This site gives information about all msm soc release details with tag + android version
Search your msm here.. Check the latest one and look for correct android version and mark that tag.
Now open one of the following links (dependent on your linux kernel version)
@rwuwon
rwuwon / mosh.md
Last active August 22, 2022 19:21
Connect to a Google Cloud Compute Engine using Mosh (mobile shell)

Connect to a Google Cloud Compute Engine using Mosh (mobile shell)

Mosh is a great way to overcome lag and flakey connection issues when accessing remote terminals over SSH: https://mosh.org/

Unfortunately, there's still not a lot of clear documentation for "idiots" because a lot of the existing guides assume a) "it just works", or b) you're already skilled enough to set everything up from scratch (assumed knowledge/use cases).

One of the problems I ran into for quite a long time yesterday was getting the darn thing to connect to my Google Cloud instance. I kept running into the mosh: Nothing received from server on UDP port 60001. [To quit: Ctrl-^ .] error (by the way - to quit, you have to press . after Ctrl-^ - it's not just Ctrl-^, there is a dot there too!)

FAQs and the like made vague spartan references to NATs, firewalls, iptables and the like and I tried out various commands and configurations on the se

@usametov
usametov / topics-search.txt
Created February 16, 2021 01:50
how to search github.com for multiple topics
Github.com ui .currently does not natively supoport search for multiple topic tags as of now. However their api allows you to query multiple tags. Below is a simple example to query github.com with ecs and go topic tags.
curl -H "Accept: application/vnd.github.mercy-preview+json" \
https://api.github.com/search/repositories?q=topic:ecs+topic:go
Response from the github can be rather verbose so lets filter only relavant info such repo url and description.
curl -H "Accept: application/vnd.github.mercy-preview+json" \
https://api.github.com/search/repositories\?q\=topic:ecs+topic:go | jq '.items[] | {url:.url, description:.description}'
@B45i
B45i / build.yml
Created November 13, 2021 15:09
GitHub Action - Build Ionic Capacitor Android app
name: Build Android
on: [push, pull_request]
jobs:
build:
name: Build APK
runs-on: ubuntu-latest
steps:
- name: Checkout source