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
# Copyright Robert Eisele https://www.xarg.org/ | |
from fractions import Fraction | |
import math | |
# Calculates (a/b)^(c/d) if solution is rational | |
def pow(a, b, c, d): | |
xn = Fraction(int(math.pow(a, c / float(d))), int(math.pow(b, c / float(d)))) | |
abc = Fraction(a, b)**c |
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/sh | |
set -e | |
set -x | |
brew update && brew upgrade | |
npm -g update | |
for package in $(npm -g outdated --parseable --depth=0 | cut -d: -f3) |
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
-- SQL to create the initial tables for the MediaWiki database. | |
-- This is read and executed by the install script; you should | |
-- not have to run it by itself unless doing a manual install. | |
-- This is a shared schema file used for both MySQL and SQLite installs. | |
-- | |
-- For more documentation on the database schema, see | |
-- https://www.mediawiki.org/wiki/Manual:Database_layout | |
-- | |
-- notes: |
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
# Find last commit for the deleted file | |
git rev-list -n 1 HEAD -- $path | |
# Checkout the commit before the the delete happened | |
git checkout $commit^ -- $path |
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 | |
echo "What have you done today?" | |
read msg | |
echo "For how long have wo worked today?" | |
read hours | |
user="Robert" | |
pass="secret" |
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
/** | |
* Copyright (c) 2016, Robert Eisele ([email protected]) | |
* Dual licensed under the MIT or GPL Version 2 licenses. | |
**/ | |
// Converts a JavaScript double number to a node Buffer | |
var DoubleToBuffer = (function() { | |
var FLOAT = new Float64Array(1) | |
return function(x) { |
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
/** | |
* @license Recursive-Primitive.js | |
* | |
* Copyright (c) 2014, Robert Eisele ([email protected]) | |
* Dual licensed under the MIT or GPL Version 2 licenses. | |
**/ | |
const add = (a, b) => b === 0 ? a : add(a + 1, b - 1); | |
const sub = (a, b) => b === 0 ? a : sub(a - 1, b - 1); | |
const mul = (a, b) => b === 1 ? a : add(mul(a, b - 1), a); |
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
### | |
# Draw some shapes on the console | |
# Copyright (c) 2014, Robert Eisele ([email protected]) | |
# Dual licensed under the MIT or GPL Version 2 licenses. | |
### | |
draw = (size, cb) -> | |
chars = [ ":", "O" ] | |
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
#!/bin/bash | |
# A simple helper file for Google Closure compiler | |
# | |
# Copyright (c) 2011, Robert Eisele ([email protected]) | |
# Dual licensed under the MIT or GPL Version 2 licenses. | |
# Usage: ./generate.sh input.js output.js | |
curl --silent -d"compilation_level=ADVANCED_OPTIMIZATIONS&output_format=text&output_info=compiled_code" --data-urlencode "js_code@$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
-- jpeg quality | |
quality = "85" | |
-- docroot of the images | |
docroot = "/var/www" | |
-- list of all sizes used | |
map_sizes = "sml" | |
-- map of prefixes : sizes to width/height - if the size doesn't exist, an error will thrown |
NewerOlder