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 | |
# Usage: shrinkray --timeout 10 --parallelism 50 --no-clang-delta shrinkray_interest.sh ./cstack.minimal.lua | |
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | |
if [ "$#" -ne 1 ]; then | |
echo "Usage: $0 <input.lua>" | |
exit 1 | |
fi | |
INPUT="$1" | |
LUA_EXEC="$SCRIPT_DIR/../src/lua" |
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
# pip install pygame | |
```python | |
import pygame | |
def play_mp3(file_path): | |
pygame.mixer.init() | |
pygame.mixer.music.load(file_path) | |
pygame.mixer.music.play() |
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 os | |
import requests | |
from take_home_test_starter.config import Config | |
BASE_URL = "https://s3-eu-west-1.amazonaws.com/vito.landcover.global/v3.0.1/2019/" | |
LATITUDES = ["S40", "S20", "N00", "N20", "N40", "N60", "N80"] |
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
use std::env; | |
use lrlex::lrlex_mod; | |
use lrpar::lrpar_mod; | |
lrlex_mod!("coconut.l"); // brings the lexer for `coconut.l` into scope. | |
lrpar_mod!("coconut.y"); // brings the Parser for `coconut.y` into scope. | |
mod ast; | |
mod instruction; |
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
#[derive(Debug)] | |
pub enum Node { | |
Add { lhs: Box<Node>, rhs: Box<Node> }, | |
Mul { lhs: Box<Node>, rhs: Box<Node> }, | |
Number { value: u64 }, | |
} |
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
#[derive(Debug, PartialEq, Clone)] | |
pub enum Op { | |
Add, // Addition operation | |
Mull, // Multiplication operation | |
Push { value: u64 }, // Load numeric value onto stack | |
} |
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/env bash | |
OUT="./mp3" | |
mkdir ${OUT} | |
for f in ls ./*.flac; do | |
echo "processing '${f}'" | |
if [ -f "${f}" ]; then | |
CMD='ffmpeg -i "'""${f}""'" ${OUT}/"'""$(echo ${f} | sed s/.flac/.mp3/)""'"' | |
eval "${CMD}" | |
fi |
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 os | |
import sys | |
def prime(n): | |
primes = [] | |
for num in range(0, n): | |
if num > 1: | |
for i in range(2, num): | |
if (num % i) == 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
from random import shuffle | |
def generate_prisoner(pick, assigned, guess): | |
return {'pick': pick, 'guess': guess, 'assigned': assigned} | |
def generate_prisoners(prisoners_count): | |
collection1 = list(range(1, prisoners_count + 1)) | |
collection2 = list(range(1, prisoners_count + 1)) |
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
set noeol | |
## Install pathogen and use a proper directory structure | |
``` | |
cd | |
mkdir -p .vim/{autoload,colors,syntax,plugin,spell,config} | |
mv .vimrc .vim/vimrc | |
ln -s .vim/vimrc .vimrc | |
cd ~/.vim | |
git clone https://github.com/tpope/vim-pathogen.git pathogen |
NewerOlder