This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
useState, | |
Dispatch, | |
SetStateAction, | |
useRef, | |
useEffect, | |
useCallback, | |
} from "react" | |
function useSafeState<S = undefined>( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'json' | |
# Grab info from the heroku cli | |
info = JSON.load(`heroku info --json`) | |
env_variables = JSON.load(`heroku config --json`) | |
buildpacks = `heroku buildpacks`.lines[1..].map{ |l| { 'url' => l[3..].chop }} | |
addons = JSON.load(`heroku addons --json`).inject(Hash.new{ |h, k| h[k] = [] }) { |h, e| | |
name = e['addon_service']['name'] | |
plan = e['plan']['name'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Basic Hello World that compiles on MacOS | |
; nasm -fmacho64 test.asm && cc test.o -Wl,-no_pie && ./a.out | |
global _main | |
extern _puts, _exit | |
section .text | |
_main: | |
; Saves the stack, not really useful here but will ensure the stack is 16 bits-aligned |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Your init script | |
# | |
# Atom will evaluate this file each time a new window is opened. It is run | |
# after packages are loaded/activated and after the previous editor state | |
# has been restored. | |
# | |
# An example hack to log to the console when each text editor is saved. | |
# | |
# atom.workspace.observeTextEditors (editor) -> | |
# editor.onDidSave -> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Avoid commiting when the commit message contains ONLY the JIRA tag | |
# Get the name of the current branch | |
current_branch = `git symbolic-ref --short HEAD` | |
# Check if we are on a JIRA branch | |
TAG_REGEX = /^([[:alpha:]]+)[-_](\d+)$/ | |
if current_branch =~ TAG_REGEX | |
file_name = ARGV[0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"Author": "MissHannahMinx", | |
"Title": "Japanese Word of The Day - Saikou 最高!", | |
"VideoUrl": "https://www.youtube.com/watch?v=3an7Nd_UJMQ", | |
"PlaceholderUrl": "https://i.ytimg.com/vi/LzOihTM-6SQ/mqdefault.jpg" | |
}, | |
{ | |
"Author": "MissHannahMinx", | |
"Title": "Japanese Word of the Day - TEENY TINY 小さい!", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:trusty | |
RUN apt-get update | |
# C/C++ | |
RUN apt-get install -y build-essential | |
# Ruby | |
RUN apt-get install -y ruby |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input = STDIN.read.split("\n") | |
input.shift # skip first line | |
puts input.map { |x| Integer(x) }.inject(&:+) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cd /code | |
if [ -e code.c ]; then | |
gcc -o runner code.c || exit 1 | |
cat input | runner | |
elif [ -e code.cpp ]; then | |
cat input | runner | |
elif [ -e code.rb ]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:trusty | |
RUN apt-get update | |
# basic build tools | |
RUN apt-get install -y build-essential | |
# Ruby | |
RUN apt-get install -y ruby | |
NewerOlder