Skip to content

Instantly share code, notes, and snippets.

@sontek
sontek / rename.sh
Created July 8, 2018 20:19
Rename author in git
#!/bin/sh
git filter-branch -f \
--index-filter 'git rm --cached --ignore-unmatch Rakefile' HEAD
git filter-branch --env-filter '
OLD_EMAIL="[email protected]"
CORRECT_NAME="John Anderson"
CORRECT_EMAIL="[email protected]"
{
"fields": [
{
"expression": {
"attribute_name": "confirmation_number",
"object_type": "attendee"
},
"header": "Confirmation #"
},
{
{
"fields": [
{
"expression": {
"attribute_name": "confirmation_number",
"object_type": "attendee"
},
"header": "Confirmation #"
},
{
{
"object_types": "attendee",
"sort_by": [
{
"descending": false,
"expression": {
"element_id": "ATTENDEE_NAME",
"attribute_name": "last_name",
"object_type": "response"
}
{
"object_types": "attendee",
"sort_by": [
{
"descending": false,
"expression": {
"element_id": "ATTENDEE_NAME",
"attribute_name": "last_name",
"object_type": "response"
}
@sontek
sontek / rendered_fonts.js
Created January 12, 2021 15:02
A way to get all rendered fonts on a page
/*
save this file as "rendered_fonts.js"
yarn add puppeteer
node rendered_fonts.js
*/
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
@sontek
sontek / animals.py
Created April 10, 2021 04:08
Graham's (9 years old) first Python program - Classifying animals
"""
Required Attributes:
1. Vertabrate or Invertebrate
2. Fur or No Fur
3. Feathers or No Feathers
4. Gills or No gills
5. Scales or No Scales
"""
class Attributes:
@sontek
sontek / migrate_from_gitlab_hosted_to_gitlab_saas.py
Created April 27, 2021 13:49
Selenium script as a work around for lack of API access to defining webhook secrets in GitLab for the GitHub integration
def import_repo_via_selenium(self, repo_name):
"""
Howto use:
1. Check your version of Chrome with about://
2. Download ChromeDriver that matches it:
https://chromedriver.chromium.org/downloads
3. Unzip and put it somewhere in $PATH, I recommend /usr/local/bin/
"""
api_url = 'https://gitlab.com/zapier/'
DEFAULT_WAIT_TIME = 15
@sontek
sontek / helloworld.c
Last active May 26, 2021 17:56
Good C code
#include <stdio.h>
int main() {
int year = 2007 ;
printf("Hello World!\n") ;
printf("CSSE 120 changed a lot in %d.\n", year) ;
return 0 ;
}
@sontek
sontek / keybase.md
Created June 9, 2021 02:04
keybase.md

Keybase proof

I hereby claim:

  • I am sontek on github.
  • I am sontek (https://keybase.io/sontek) on keybase.
  • I have a public key ASDV97u1WYLtLLSCDyELwsEhd9Bg45Stl1-QlPM3ups_jAo

To claim this, I am signing this object: