Skip to content

Instantly share code, notes, and snippets.

View agamm's full-sized avatar
🍪
Cookie: cookies=∞;\r\n

Agam More agamm

🍪
Cookie: cookies=∞;\r\n
View GitHub Profile

If you have many files of go test runs concat like so: cat <path>/* > concat_tests.raw

Call: python t.py concat_tests.raw

@agamm
agamm / color-range-slider.markdown
Last active October 13, 2022 22:21
Color range slider with animated emoji.

Color range slider

As the slider handle is dragged, it's background color matches that of the gradient track below.

Uses jQueryUI slider.

A Pen by Agam on CodePen.

License.

@agamm
agamm / mbox-extract-attachments3.py
Last active October 13, 2022 22:24 — forked from kellerza/mbox-extract-attachments3.py
mbox-extract-attachments3.py with fix to support iso-8859-8-i encoding.
#!/usr/bin/env python3
# pylint: disable=invalid-name
"""mbox-extract-attachments3 - Extract attachments from mbox files.
Good companion for Google Takeout https://takeout.google.com/settings/takeout
Modified by http://github.com/kellerza from
https://github.com/PabloCastellano/pablog-scripts/
- Python3 & linter errors
- New Filenames
@agamm
agamm / convert.py
Last active October 13, 2022 22:25
Python money/currency format and convert string to integer.
from re import sub, search
from decimal import Decimal
# Not production ready
def convert(m):
r = 1.0
if "£" in m:
r = 1.28 # Make sure to check this (conversion rate between pounds and usd)
z = 0
@agamm
agamm / showAllResolved.md
Last active February 26, 2024 08:56
Show all resolved comments in a Github Pull Request

Run this in the console:

document.querySelectorAll('span.Details-content--closed').forEach((e)=>{e.click()})

From the creator of: unzip.dev 🚀

@agamm
agamm / Change Netflix playback speed (browser).md
Last active October 13, 2022 22:05
Speed up your netflix binge watching without any needless extensions.

Open the console (Cmd + Option + J / ctrl+shift+j)
$('video').playbackRate = 1.2 - will speed by 20%

unzip.dev🚀

@agamm
agamm / index.android.js
Created May 10, 2016 15:12
React native basic navigation
/**
* Sample React Native App
* https://github.com/facebook/react-native
*/
import React, { Component } from 'react'
import { AppRegistry, StyleSheet, Text, View, Navigator, ToolbarAndroid, TouchableHighlight } from 'react-native'
class reactgame extends Component {
render () {
@agamm
agamm / run.bat
Last active October 13, 2022 22:06
Start react-native on Windows
set /p id="(Reminder) Did you start a vm? and is it available in adb? "
start cmd /k react-native start
rem *** HACK ALERT: Sleep for 10 seconds ***
ping -n 10 127.0.0.1 > nul
start cmd /k react-native run-android
REM Might you want to visit unzip.dev ?
@agamm
agamm / gist:e0363f4998e39703daa0
Created May 16, 2015 20:45
Custom Go HTTP Response
func all(w http.ResponseWriter, r *http.Request) {
someText := "Some custom message for the redirect"
hj, ok := w.(http.Hijacker)
if !ok {
http.Error(w, "Webserver doesn't support hijacking", http.StatusInternalServerError)
return
}
conn, bufrw, err := hj.Hijack()
checkErr(w, err)
@agamm
agamm / random.js
Last active October 13, 2022 22:07
Javascript random choice picker.
function makemychoice() {
args = Array.prototype.slice.call(arguments);
return ( args[~~(args.length * Math.random())] ) + " was chosen.";
}
// Example: makemychoice("Go to run", "Go to swim", "Fix bug");
// from the creator of unzip.dev