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
private boolean isLong(String str) { | |
try { | |
Long.parseLong(str); | |
} | |
catch(NumberFormatException e) { | |
return false; | |
} | |
return true; | |
} |
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 | |
# make sure the behaviour works | |
haxe test.hxml | |
exit |
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 | |
# find node | |
NODE=$(which node) | |
# get the latest commit | |
COMMIT=$(git rev-parse HEAD) | |
# if it cannot find a node installation | |
if [[ -z $NODE ]]; 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
// ./hooks/minify.js | |
var UglifyJS = require("uglify-js"); // run "npm install uglify-js" in the hooks directory first! | |
var fs = require('fs'); | |
exports.hook = function(flow, done) { | |
var basePath = flow.project.project.app.output + '/web/' + flow.project.project.app.name; | |
var result = UglifyJS.minify(basePath + '.js', { | |
mangle: true // set to false if you run into issues | |
}); | |
fs.writeFile(basePath + '.min.js', result.code, function(err) { |
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
function [ result ] = qaxisangle( axis, ang ) | |
%QAXISANGLE Generates a quaternion which rotates by ang around axis | |
% some helpers | |
c = cos(ang / 2); | |
s = sin(ang / 2); | |
axis = axis ./ norm(axis); | |
result = [ | |
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
class PID | |
{ | |
public double KP { get; set; } | |
public double KI { get; set; } | |
public double KD { get; set; } | |
public double SetPoint { get; set; } | |
public double MinSet { get; set; } | |
public double MaxSet { get; set; } |
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 | |
haxelib git flow https://github.com/underscorediscovery/flow.git | |
haxelib git snow https://github.com/underscorediscovery/snow.git | |
haxelib git luxe https://github.com/underscorediscovery/luxe.git | |
haxelib git mint https://github.com/underscorediscovery/mint.git | |
wget http://build.luxeengine.com/snow/latest.all.zip |
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
[Desktop Entry] | |
Name=Dispay Name of App | |
GenericName=Basic Name of App | |
Comment=Comment | |
Keywords=keywords;separated;with;semi-colons | |
Exec=/path/to/file/to/run with parameters | |
Terminal=true|false | |
Type=Application | |
StartupNotify=true | |
Icon=/path/to/icon.png |
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 packages | |
\usepackage{array} %for vertical thick lines in tables | |
\usepackage{multirow} %multirow tables | |
\usepackage{nicefrac} %for fractions like 1/4 | |
%Package list ends here | |
% Macro for 'List of Symbols', 'List of Notations' etc... | |
\def\listofsymbols{\input{symbols} \clearpage} | |
\def\addsymbol #1: #2#3{$#1$ \> \parbox{5in}{#2 \dotfill \pageref{#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
# secs is the total number of seconds | |
secs = 5412 | |
# calculate things.. | |
hours = secs / 3600 | |
minutes = (secs - hours * 3600) / 60 | |
seconds = secs % 60 | |
# now print the results! | |
print '%02d:%02d:%02d' % (hours, minutes, seconds) |