Skip to content

Instantly share code, notes, and snippets.

@samjaninf
samjaninf / jitai.user.js
Created May 29, 2019 17:16 — forked from obskyr/jitai.user.js
Jitai (字体): A fairly full-featured font randomizer for WaniKani.
// ==UserScript==
// @name Jitai
// @version 1.3.2
// @description Display WaniKani reviews in randomized fonts, for more varied reading training.
// @author Samuel (@obskyr)
// @copyright 2016-2018, obskyr
// @license MIT
// @namespace http://obskyr.io/
// @homepageURL https://gist.github.com/obskyr/9f3c77cf6bf663792c6e
// @icon http://i.imgur.com/qyuR9bD.png
@samjaninf
samjaninf / gist:a79a970ccf49752b786f3ac0730bd9fb
Last active January 3, 2019 16:07 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
@media (min-width: 768px){
body{ padding-top: 150px; }
}
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
@samjaninf
samjaninf / to_array.js
Created September 26, 2018 18:36 — forked from pcbje/to_array.js
Convert tabular text (csv, tsv, etc.) to javascript array
var to_array = function(text, delimeter, has_header, header_size) {
var lines = text.split('\n');
var columns = has_header ? lines[header_size - 1].split(delimeter) : null;
var rows = [];
for (var i=header_size; i<lines.length; i++) {
var array = lines[i].split(delimeter);
var row = {};
for (var j in array) {
@samjaninf
samjaninf / The Technical Interview Cheat Sheet.md
Created September 26, 2018 01:08 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
#### Exercises
1. Define and compare recursion and iteration.
Recursion is a procedure that calls itself until a certain condition (base case) is reached. Recursive solutions can be slower and are subjected to system limitations
Iteration is a procedure that uses loop to repeat a process. Iterative solutions may be harder to implement.
2. Name five algorithms that are commonly implemented by recursion.
@samjaninf
samjaninf / Blockchain.jl
Created August 16, 2018 17:33 — forked from TestSubjector/Blockchain.jl
A very basic implementation of a blockchain in Julia.
using SHA
"""
An individual block structure
"""
struct Block
index::Int
timestamp::DateTime
data::String
previous_hash::String
https://www.google.com/fusiontables/DataSource?docid=1qwHuS2zIBqK_xxTtg-j_loRHqCVpcld-a2Q6kM0#rows:id=1
Emergency Preparedness
Pioneering Wireless
Offbeat Internet
Application Software
@samjaninf
samjaninf / 00README.md
Created February 20, 2018 06:48 — forked from mwpastore/00README.md
Lightning Fast WordPress: Caddy+Varnish+PHP-FPM

README

This gist assumes you are migrating an existing site for www.example.com — ideally WordPress — to a new server — ideally Ubuntu Server 16.04 LTS — and wish to enable HTTP/2 (backwards compatibile with HTTP/1.1) with always-on HTTPS, caching, compression, and more. Although these instructions are geared towards WordPress, they should be trivially extensible to other PHP frameworks, other FastCGI backends, and even non-FastCGI backends (using proxy in lieu of fastcgi in the terminal Caddyfile stanza).

Quickstart: Use your own naked and canonical domain names instead of example.com and www.example.com and customize the Caddyfile and VCL provided in this gist to your preferences!

These instructions target Varnish Cache 4.1, PHP-FPM 7.0, and Caddy 0.10. (I'm using MariaDB 10.1 as well, but that's not relevant to this guide.)

@samjaninf
samjaninf / nginx.conf
Created February 14, 2018 06:58 — forked from nrollr/nginx.conf
NGINX config for SSL with Let's Encrypt certs
# Advanced config for NGINX
server_tokens off;
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options nosniff;
# Redirect all HTTP traffic to HTTPS
server {
listen 80;
server_name www.domain.com domain.com;
return 301 https://$host$request_uri;
@samjaninf
samjaninf / zimbra-letsencrypt-renew.md
Created September 18, 2017 17:05 — forked from ugurerkan/zimbra-letsencrypt-renew.md
Zimbra 8.6.0 Letsencrypt SSL renew walkthrough.