Skip to content

Instantly share code, notes, and snippets.

View Yuffster's full-sized avatar
🕳️
ᕕ( ᐛ ) ᕗ

Michelle Steigerwalt Yuffster

🕳️
ᕕ( ᐛ ) ᕗ
View GitHub Profile
@kgersen
kgersen / setup-lxd for crostini.txt
Created February 28, 2019 04:24
setup lxd client in penguin crostini vm (requires ChromeOS linux apps)
source: https://discuss.linuxcontainers.org/t/using-lxd-on-your-chromebook/3823
ctrl-alt-t to access crosh
vsh termina (or vmc start termina)
lxc config set core.https_address :8443
lxc config set core.trust_password some-password
# create an Ubuntu container
lxc launch ubuntu:18.04 c1
# copy the lxc command from it
@codePrincess
codePrincess / .swift
Last active August 10, 2018 18:26
Basic doodling with Apple Pencil
import Foundation
import UIKit
public class DoodleCanvas : UIImageView {
let pi = CGFloat(Double.pi)
let forceSensitivity: CGFloat = 4.0
var pencilTexture = UIColor(patternImage: UIImage(named: "PencilTexture")!)
let defaultLineWidth : CGFloat = 6

Git Quick Reference

Git is awesome, but a lot of the time, I just need a quick reference for which commands to use in which situations. Here Goes!


Basics

git init

@kyledrake
kyledrake / ferengi-plan.txt
Last active January 10, 2025 14:02
How to throttle the FCC to dial up modem speeds on your website using Nginx
# The blog post that started it all: https://neocities.org/blog/the-fcc-is-now-rate-limited
#
# Current known FCC address ranges:
# https://news.ycombinator.com/item?id=7716915
#
# Confirm/locate FCC IP ranges with this: http://whois.arin.net/rest/net/NET-165-135-0-0-1/pft
#
# In your nginx.conf:
location / {
@keis
keis / coro.py
Created April 14, 2014 08:27
asyncio examples
import asyncio
@asyncio.coroutine
def waiting(r):
print("hello from waiting -", r)
yield from asyncio.sleep(2)
print("bye from waiting -", r)
return r
@Zolomon
Zolomon / rearrange.hs
Last active September 21, 2024 04:15
Calculate best rearrange in Discworld MUD.
module Rearrange where
import Control.Applicative
import Data.List
main :: IO ()
main = do
putStrLn $ show (getMaxStats maPo)
data Stats = Stats { str :: Int,
@jo
jo / js-crypto-libraries.md
Last active May 4, 2025 22:08
List of JavaScript Crypto libraries.

JavaScript Crypto Libraries

List some crypto libraries for JavaScript out there. Might be a bit out dated. Scroll to the bottom.

WebCryptoAPI

http://www.w3.org/TR/WebCryptoAPI/

This specification describes a JavaScript API for performing basic cryptographic operations in web applications, such as hashing, signature generation and verification, and encryption and decryption. Additionally, it describes an API for applications to generate and/or manage the keying material necessary to perform these operations. Uses for this API range from user or service authentication, document or code signing, and the confidentiality and integrity of communications.

@Yuffster
Yuffster / Element.Data.js
Created July 25, 2012 05:48
Data attribute API extension for MooTools.
Element.implement({
getData: function() {
var data = {}, attrs = this.attributes;
for (var i=0; i<attrs.length; i++){
k = attrs.item(i).nodeName;
if (k.match(/^data-/)) data[k.replace(/^data-/, '')] = attrs.item(i).nodeValue;
} return data;
},
@jonathantneal
jonathantneal / matchesSelector.polyfill.js
Created July 6, 2012 21:51
matchesSelector Polyfill // returns whether an element matches a selector
this.Element && function(ElementPrototype) {
ElementPrototype.matchesSelector = ElementPrototype.matchesSelector ||
ElementPrototype.mozMatchesSelector ||
ElementPrototype.msMatchesSelector ||
ElementPrototype.oMatchesSelector ||
ElementPrototype.webkitMatchesSelector ||
function (selector) {
var node = this, nodes = (node.parentNode || node.document).querySelectorAll(selector), i = -1;
while (nodes[++i] && nodes[i] != node);
@Yuffster
Yuffster / app.rb
Created May 26, 2012 09:39
Continuous Integration Server in < 20 Lines
require 'rubygems'
require 'sinatra'
require 'json'
require 'logger'
before do
#only allow access to GitHub.
ips = ['207.97.227.253', '50.57.128.197', '108.171.174.178'];
halt 404, "D:&lt;" unless ips.find_index(@env['REMOTE_ADDR'])>=0
end