Skip to content

Instantly share code, notes, and snippets.

View MonkeyIsNull's full-sized avatar
:shipit:
Collating

Adam Guyot MonkeyIsNull

:shipit:
Collating
View GitHub Profile
@sshymko
sshymko / install_mysql_client.sh
Last active March 14, 2024 20:10
Install MySQL 5.7 client on Amazon Linux 2
#!/bin/sh
sudo yum install -y https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
sudo yum install -y mysql-community-client
@kakaLQY
kakaLQY / testbatch_test.go
Last active February 6, 2023 10:33
Golang batch get from buffered channel with a maximum number.
package testbatch
import (
"testing"
"time"
)
func TestBatch(t *testing.T) {
bufCh := make(chan int, 20)
go func() {
@zonca
zonca / us_universities.csv
Last active February 29, 2024 05:57
List of US University with standard name and homepage address, type any portion of the name or the website in the search box, source https://github.com/endSly/world-universities-csv
name url
Abilene Christian University http://www.acu.edu/
Academy of Art College http://www.academyart.edu/
Adams State College http://www.adams.edu/
Adelphi University http://www.adelphi.edu/
Adler School of Professional Psychology http://www.adler.edu/
Adrian College http://www.adrian.edu/
Agnes Scott College http://www.scottlan.edu/
Air Force Institute of Technology http://www.afit.af.mil/
Alabama Agricultural and Mechanical University http://www.aamu.edu/
@mudphone
mudphone / curry.exs
Last active August 29, 2015 14:20
Elixir Curry... is delicious
defmodule Math do
def add(x, y) do
x + y
end
def add(x, y, z) do
x + y + z
end
@kristopherjohnson
kristopherjohnson / pipe-forward.swift
Last active March 29, 2024 19:44
Swift: define F#-style pipe-forward (|>) operator that evaluates from left to right.
// F#'s "pipe-forward" |> operator
//
// Also "Optional-chaining" operators |>! and |>&
//
// And adapters for standard library map/filter/sorted
infix operator |> { precedence 50 associativity left }
infix operator |>! { precedence 50 associativity left }
infix operator |>& { precedence 50 associativity left }
infix operator |>* { precedence 50 associativity left }
@kendellfab
kendellfab / read_line.go
Created November 11, 2013 17:41
Golang --> Read file line by line.
func readLine(path string) {
inFile, _ := os.Open(path)
defer inFile.Close()
scanner := bufio.NewScanner(inFile)
scanner.Split(bufio.ScanLines)
for scanner.Scan() {
fmt.Println(scanner.Text())
}
}
@dysinger
dysinger / vlc-stream-desktop-to-mp4.sh
Created March 7, 2012 01:40
Stream your desktop with VLC (screencam)
# stream video from your desktop & audio from another device into an h264/mp3 avi video with VLC
vlc screen:// --screen-fps=12 \
--input-slave=alsa://hw:1,0 \
--qt-start-minimized \
--sout "#transcode{venc=x264,vcodec=h264,fps=12,vb=640,acodec=mp3,channels=1,ab=64}\
:std{access=file,mux=mp4,dst=screencam-$(date -u +%Y-%m-%d-%s).avi}"
@ijt
ijt / tailf.hs
Created June 30, 2011 06:26
Haskell example of tailing a file
#!/usr/bin/env runhaskell
-- Example of tailing a file, using two communicating Haskell threads. It's not
-- really necessary to do this concurrently, but the approach here generalizes
-- nicely if we want to filter or transform the output.
import Control.Concurrent
import Control.Monad
import System.Environment
import System.Exit
@ato
ato / debug.clj
Created December 9, 2009 11:42
Simpler debug-repl that works with unmodified Clojure
;; Inspired by George Jahad's version: http://georgejahad.com/clojure/debug-repl.html
(defmacro local-bindings
"Produces a map of the names of local bindings to their values."
[]
(let [symbols (map key @clojure.lang.Compiler/LOCAL_ENV)]
(zipmap (map (fn [sym] `(quote ~sym)) symbols) symbols)))
(declare *locals*)
(defn eval-with-locals