Skip to content

Instantly share code, notes, and snippets.

View encody's full-sized avatar
☠️
Only mostly dead

Jacob Lindahl encody

☠️
Only mostly dead
View GitHub Profile
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Basics</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<main>
<h1>Blog</h1>
@encody
encody / button.css
Created July 6, 2016 12:43
Button Ripple Effect
/*
Video Guide: https://youtu.be/QI2rDHQM5Pc
*/
body {
background-color: #333;
}
button {
font-family: "Roboto";
@encody
encody / hamburger.js
Last active July 24, 2016 04:22
Transforming Hamburger Menu
/*
Video Guide: https://youtu.be/eqhEq9_uVas
*/
var menus = document.getElementsByClassName('hamburger-menu');
[].forEach.call(menus, function (m) {
m.addEventListener('click', function () {
m.classList.toggle('open');
});
@encody
encody / index.html
Last active July 24, 2016 04:23
Stopwatch
<!--
Video Guide: https://youtu.be/fF-vtP3sjPc
-->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Stopwatch</title>
<link rel="stylesheet" href="stopwatch.css">
@encody
encody / index.html
Created July 24, 2016 04:10
Toggle Switches
<!--
Video Guide: https://youtu.be/39b_FstkhSM
-->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Toggle Switches</title>
<link rel="stylesheet" href="toggle-switches.css">
@encody
encody / draw.css
Created July 31, 2016 00:13
Simple Drawing Web App
/*
Video Guide: https://youtu.be/amXSWXQssww
*/
body {
margin: 0;
}
.top-bar {
display: flex;
@encody
encody / Vector.js
Created August 6, 2016 02:24
Analog Clock
/*
Video Guide: https://youtu.be/1q7EEd6Huf0
*/
function Vector (magnitude, angle) {
var m, a;
this.getX = function () {
return m * Math.cos(a);
};
@encody
encody / Election_basic.sol
Created April 20, 2018 23:10
Smart Contracts and Dapps Lecture Files
pragma solidity ^0.4.0;
contract Election_basic {
mapping (string => uint) votes;
function vote (string candidate) public {
votes[candidate]++;
}
function getVotes (string candidate) public view returns (uint) {
@encody
encody / index.js
Created October 1, 2018 17:41
Generates list of most frequently used kanji not in Joyo list
// from https://imabi.net/joyokanjilist.htm
const joyo = "一 九 七 二 人 入 八 力 十 下 三 千 上 口 土 夕 大 女 子 小 山 川 五 天 中 六 円 手 文 日 月 木 水 火 犬 王 正 出 本 右 四 左 玉 生 田 白 目 石 立 百 年 休 先 名 字 早 気 竹 糸 耳 虫 村 男 町 花 見 貝 赤 足 車 学 林 空 金 雨 青 草 音 校 森 刀 万 丸 才 工 弓 内 午 少 元 今 公 分 切 友 太 引 心 戸 方 止 毛 父 牛 半 市 北 古 台 兄 冬 外 広 母 用 矢 交 会 合 同 回 寺 地 多 光 当 毎 池 米 羽 考 肉 自 色 行 西 来 何 作 体 弟 図 声 売 形 汽 社 角 言 谷 走 近 里 麦 画 東 京 夜 直 国 姉 妹 岩 店 明 歩 知 長 門 昼 前 南 点 室 後 春 星 海 活 思 科 秋 茶 計 風 食 首 夏 弱 原 家 帰 時 紙 書 記 通 馬 高 強 教 理 細 組 船 週 野 雪 魚 鳥 黄 黒 場 晴 答 絵 買 朝 道 番 間 雲 園 数 新 楽 話 遠 電 鳴 歌 算 語 読 聞 線 親 頭 曜 顔 丁 予 化 区 反 央 平 申 世 由 氷 主 仕 他 代 写 号 去 打 皮 皿 礼 両 曲 向 州 全 次 安 守 式 死 列 羊 有 血 住 助 医 君 坂 局 役 投 対 決 究 豆 身 返 表 事 育 使 命 味 幸 始 実 定 岸 所 放 昔 板 泳 注 波 油 受 物 具 委 和 者 取 服 苦 重 乗 係 品 客 県 屋 炭 度 待 急 指 持 拾 昭 相 柱 洋 畑 界 発 研 神 秒 級 美 負 送 追 面 島 勉 倍 真 員 宮 庫 庭 旅 根 酒 消 流 病 息 荷 起 速 配 院 悪 商 動 宿 帳 族 深 球 祭 第 笛 終 習 転 進 都 部 問 章 寒 暑 植 温 湖 港 湯 登 短 童 等 筆 着 期 勝 葉 落 軽 運 遊 開 階 陽 集 悲 飲 歯 業 感 想 暗 漢 福 詩 路 農 鉄 意 様 緑 練 銀 駅 鼻 横 箱 談 調 橋 整 薬 館 題 士 不 夫 欠 氏 民 史 必 失 包 末 未 以 付 令 加 司 功 札 辺 印 争 仲 伝 共 兆 各 好 成 灯 老 衣 求 束 兵 位 低 児 冷 別 努 労 告
@encody
encody / main.rs
Created February 18, 2019 17:16
Hash Comparison
use crypto_hash::*;
// Converts a 32-bit unsigned integer into its respective byte array
fn u32_bytes (x: u32) -> [u8; 4] {
[
(x >> 0x0 * 8) as u8,
(x >> 0x1 * 8) as u8,
(x >> 0x2 * 8) as u8,
(x >> 0x3 * 8) as u8,
]