Skip to content

Instantly share code, notes, and snippets.

View pyokagan's full-sized avatar

Paul Tan pyokagan

View GitHub Profile
@pyokagan
pyokagan / SeEduDevProcessNotes.adoc
Last active January 2, 2023 12:53
Some notes on the SE-EDU development process

Some notes on the SE-EDU development process

1. Contribution process overview

  1. Create a PR

  2. When ready, submit a new iteration via CanIHasReview.

  3. Wait/respond to review comments.

  4. Make changes, go back to step 2, repeat indefinitely.

This file has been truncated, but you can view the full file.
@pyokagan
pyokagan / prsummary-generator.html
Last active August 26, 2017 16:14
GitHub PR summary generator
<!DOCTYPE html>
<html>
<head>
<title>Github PR Commit Summary Generator</title>
<meta charset="utf-8">
<script type="text/javascript">
(function() {
/**
* Promise wrapper around XMLHttpRequest
*/
/*
* Minimal Android/SDL-specific main program
* */
#include "Python.h"
#include <locale.h>
#include "SDL.h"
#include <string.h>
int
main(int argc, char *argv[])
import struct
import binascii
import zlib
f = open('out.png', 'wb')
# Write PNG header
f.write(bytes([137, 80, 78, 71, 13, 10, 26, 10]))
# Write IHDR chunk
f.write(struct.pack('!I', 13)) # Chunk size
data = b'IHDR' + struct.pack('!IIBBBBB', 2, 2, 8, 6, 0, 0, 0)
480: b5b0 push {r4, r5, r7, lr}
482: b084 sub sp, #16
484: af00 add r7, sp, #0
486: e9c7 0102 strd r0, r1, [r7, #8]
48a: 607a str r2, [r7, #4]
48c: 687b ldr r3, [r7, #4]
48e: 2b00 cmp r3, #0
490: d015 beq.n 4be <PIDcontrol+0x3e>
492: f640 03b0 movw r3, #2224 ; 0x8b0
496: f2c1 0300 movt r3, #4096 ; 0x1000
r"""Simple Python templates
USAGE
------
`render()` compiles and renders a template, returning a string:
>>> render('Hello {{name}}!', name='World')
'Hello World!'
`compile()` compiles a template into a function for later use:
#!/usr/bin/env python3
import sys
import re
import argparse
import subprocess
import requests
def get_remote_owner_repo(remote):
"Returns the github owner and repo of the remote"
@pyokagan
pyokagan / README.rst
Last active August 29, 2015 14:17
Google Summer of Code 2015 proposal for git

Make git-pull and git-am builtins

Abstract

git-pull and git-am are frequently used git subcommands. However, they are porcelain commands and implemented as shell scripts, which has some limitations which can cause poor performance, especially in non-POSIX environments like Windows. I propose to rewrite these scripts into low level C code and make them builtins. This will increase git's portability, and may

@pyokagan
pyokagan / gist:fa20ece86a9774d02719
Last active August 29, 2015 14:00
Working Android 4.4 emulator

Problem was that noemulatedsd was not set in /fstab.goldfish which led to /mnt/secure/asec to not be mounted at boot. I had to look through Android's source code to find this -_-. Why google.

Steps to get working emulator:

  1. Install Android SDK Tools Only. The directory where the SDK is installed will henceforth be known as <sdk>.
  2. Launch the Android SDK Manager, install everything under the Android 4.4.2 group
  3. Now overwrite the ramdisk.img file (located at <sdk>/add-ons/addon-google_apis-google-19/images/armeabi-v7a with this modified version. This is the ramdisk file used by the Google APIs (Google Inc.) - API Level 19 device target.
  4. Launch the Android ADB Manager, create a new Android Virtual Device. Make sure the target is set to Google APIs (Google Inc.) - API Level 19. Give the device plenty of RAM, and make sure that there is a SD Card!. (Also, remember to enable GPU Acceler