Skip to content

Instantly share code, notes, and snippets.

@ctsrc
ctsrc / README.md
Last active April 29, 2024 19:18 — forked from niw/README.en.md
Guide: Run FreeBSD 13.1-RELEASE for ARM64 in QEMU on Apple Silicon Mac (MacBook Pro M1, etc) with HVF acceleration (Hypervisor.framework)
@acamino
acamino / HttpClientApproach.cs
Last active April 25, 2024 18:01
4 Ways to Parse a JSON API with C#
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
namespace HttpClientApproach
{
internal class Contributor
{
public string Login { get; set; }
@alirobe
alirobe / reclaimWindows10.ps1
Last active April 26, 2024 17:59
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
###
###
### UPDATE: For Win 11, I recommend using this tool in place of this script:
### https://christitus.com/windows-tool/
### https://github.com/ChrisTitusTech/winutil
### https://www.youtube.com/watch?v=6UQZ5oQg8XA
### iwr -useb https://christitus.com/win | iex
###
###
@john2x
john2x / 00_destructuring.md
Last active April 23, 2024 13:18
Clojure Destructuring Tutorial and Cheat Sheet

Clojure Destructuring Tutorial and Cheat Sheet

(Related blog post)

Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.

Vectors and Sequences

@cmlsharp
cmlsharp / !!
Last active November 26, 2019 11:57
Repeat most recent command in fish
# Add this to your ~/.config/fish/config.fish
# Syntax:
# To just rerun your last command, simply type '!!'
# '!! sudo' will prepend sudo to your most recent command
# Running !! with anything other than sudo will append the argument to your most recent command
# To add another command to prepend list remove the # on line 10 and put the command in the quotes. Repeat as needed
function !!;
set prevcmd (history | head -n 1)
if test "$argv"
if test "$argv" = "sudo" #; or "any other command you want to prepend"

Customisable Animated Donut Chart

Few lines of code to create animated Donut charts. Their size and the thickness of their strokes can be easily edited via CSS. The javascript will do the rest!

A Pen by Joey Clouvel on CodePen.

License.

@bpsm
bpsm / gist:1858654
Created February 18, 2012 10:31
g[un]zip input to output
(ns clj-gunzip.core
(:require [clojure.java.io :as io])
(:require [clojure.string :as str])
(:import java.util.zip.GZIPInputStream
java.util.zip.GZIPOutputStream))
(defn gunzip
"Writes the contents of input to output, decompressed.
input: something which can be opened by io/input-stream.
@bnyeggen
bnyeggen / clojure_hive_jdbc.clj
Created December 13, 2011 15:12
Clojure to Hive via JDBC
(comment Add [org.clojure/java.jdbc "0.1.1"] to project dependencies)
(ns myproject.core
(:use [clojure.java.jdbc :only [with-connection, with-query-results]]))
(let [db-host "MyHost"
db-port 10000
db-name "default"]
(def db {:classname "org.apache.hadoop.hive.jdbc.HiveDriver" ; must be in classpath
:subname (str "//" db-host ":" db-port "/" db-name)
@dansimau
dansimau / bandwidth-usage.sh
Created August 3, 2011 12:31
Display realtime bandwidth usage for a given interface (Linux only)
#!/bin/bash
#
# Display the realtime bandwidth usage for the specified interface.
#
# dsimmons@squiz.co.uk
# 2011-08-03
#
# Number of seconds to average data over
avgsecs=3