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
#include <stdio.h> | |
#include <stdbool.h> | |
#include <signal.h> | |
#include <libwebsockets.h> | |
static bool bExit; | |
static int callback(struct lws *wsi, enum lws_callback_reasons reason, void *user, void *in, size_t len); | |
static const struct lws_protocols protocols[] = { |
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
package main | |
import ( | |
"context" | |
"flag" | |
"fmt" | |
"io" | |
"net" | |
"net/http" | |
"os" |
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 bash | |
curl https://s3.amazonaws.com/heroku-jvm-buildpack-vi/vim-7.3.tar.gz --output vim.tar.gz | |
mkdir vim && tar xzvf vim.tar.gz -C vim | |
export PATH=$PATH:/app/vim/bin |
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
// ==UserScript== | |
// @name BitMex USD Converter | |
// @namespace https://bitmex.com/ | |
// @version 0.11 | |
// @description Get some sanity into your gambling. | |
// @author koinkraft | |
// @grant none | |
// @include https://bitmex.com/* | |
// @include https://www.bitmex.com/* | |
// @require https://code.jquery.com/jquery-2.1.4.min.js |
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 elixir | |
defmodule FizzBuzz do | |
def check(x) when (rem(x, 3) == 0) and (rem(x, 5) == 0) do | |
IO.puts "FizzBuzz" | |
end | |
def check(x) when rem(x, 3) == 0 do | |
IO.puts "Fizz" | |
end |
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
ruby -run -e httpd . -p 5000 |
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 | |
# create sample file | |
original=original.txt | |
rm -f $original | |
touch $original | |
for x in $(seq 100); do | |
echo $x >> $original | |
done |
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 | |
set -u | |
for i in $(seq 1 20); do | |
divisible_by_three=$(expr $i % 3) | |
divisible_by_five=$(expr $i % 5) | |
[ $divisible_by_three -eq 0 ] && [ $divisible_by_five -eq 0 ] && echo "Fizz Buzz" && continue | |
[ $divisible_by_three -eq 0 ] && echo "Fizz" && continue | |
[ $divisible_by_five -eq 0 ] && echo "Buzz" && continue |
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
grep title cita.json | sed -e 's/.*: "//' -e 's/",//' | sort > titles.txt | |
cat titles.txt | uniq > titles_uniq.txt | |
diff titles.txt titles_uniq.txt | grep '<' | cut -c 3- |
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
# build go static binary from root of project | |
gostatic(){ | |
local dir=$1 | |
if [[ -z $dir ]]; then | |
dir=$(pwd) | |
fi | |
local name=$(basename "$dir") | |
( | |
cd $dir | |
echo "Building static binary for $name in $dir" |
NewerOlder