Skip to content

Instantly share code, notes, and snippets.

@sqren
sqren / clean-repos.sh
Last active Aug 29, 2015
Tradeshift: Update all repos, fix pom and clean
View clean-repos.sh
# Run the following in the folder containing all ts repos.
# Git pull
for dir in */; do
cd $dir
echo "Opening ${dir} and git pull"
git pull
cd ..
done
@sqren
sqren / angular-performance.js
Last active Aug 29, 2015
Performance bookmarklet for Angularjs
View angular-performance.js
var bindings = document.getElementsByClassName('ng-binding').length;
var scopes = document.getElementsByClassName('ng-scope').length;
var bodyScope = angular.element(document.querySelector('body')).scope();
var watchers = bodyScope && bodyScope.$$watchers ? bodyScope.$$watchers.length : '?';
var getWatchers = function () {
var root = document.getElementsByTagName('body')[0];
var numberOfWatches = 0;
@sqren
sqren / tradeshift.zsh
Created Oct 23, 2014
Tradeshift shell configuration
View tradeshift.zsh
# TS home folder
export TS_HOME=~/ts-code/
# tell Maven where Java7 is
export JAVA_HOME=`/usr/libexec/java_home -v 1.7`
# Riak needs at least a ulimit of 4096
ulimit -n 10240
# Increase allowed memory consumption for Maven
@sqren
sqren / grunt-test.md
Last active Aug 29, 2015
Grunt node debugging
View grunt-test.md

Start grunt

cd ~/ts-code/Apps-Server/

/usr/local/bin/node --debug-brk=52713 --debug-port=5858 --nolazy /usr/local/bin/grunt server

Start node inspector

node-inspector --web-port=9090

Open Developer tools

@sqren
sqren / squash-commits.sh
Last active Oct 30, 2015
Squash commits from branch
View squash-commits.sh
git checkout master
git checkout -b master-squash
git merge --squash <branch-to-squash>
View Example manifest for Tradeshift
{
"app": {
"redirect_uri": "http://requestb.in/zqe6mrzq",
"main": "http://localhost:8889/tradeshift-proxy/auth/login?response_type=code&client_id=sqren.sqrentest&redirect_uri=http://requestb.in/zqe6mrzq&scope=openid offline"
},
"tradeshift_version": "5.0",
"default_locale": "en-GB",
"locales": {
"en-GB": {
"app_desc": "This is a test by sqren",
@sqren
sqren / getTime.js
Created Dec 15, 2015
Measure time since start
View getTime.js
var getTime = (function() {
var start = new Date().getTime();
return function () {
var end = new Date().getTime();
var time = end - start;
return time;
};
})();
@sqren
sqren / Sublime Text Preferences
Last active Dec 19, 2015
My Sublime Text Preferences.Tab size, trim trailing white space etc.
View Sublime Text Preferences
{
"color_scheme": "Packages/User/Monokai (SL).tmTheme",
"fade_fold_buttons": false,
"folder_exclude_patterns": [
".svn",
".git",
".hg",
"CVS",
"auditlog",
"i18n",
@sqren
sqren / Sublime Text Keymappings
Created Jul 11, 2013
My default keymappings for Sublime Text: - Toggle sidebar - Refresh sidebar - Search through files
View Sublime Text Keymappings
[
{ "keys": ["super+b"], "command": "toggle_side_bar" },
{ "keys": ["ctrl+r"], "command": "refresh_folder_list" },
{ "keys": ["alt+space"], "command": "show_overlay", "args": {"overlay": "goto", "show_files": true} }
]
@sqren
sqren / tesseract-wconf.patch
Last active Dec 20, 2015
Adds confidence parameter for Tesseract Can be added to Homebrew Formula: /usr/local/Library/Formula/tesseract.rb Read more about Homebrew patches: https://github.com/mxcl/homebrew/wiki/Formula-Cookbook#patches
View tesseract-wconf.patch
--- /api/baseapi.cpp
+++ /api/baseapi.cpp
@@ -1041,6 +1041,7 @@
hocr_str->add_str_int(" ", top);
hocr_str->add_str_int(" ", right);
hocr_str->add_str_int(" ", bottom);
+ hocr_str->add_str_int("; x_wconf ", ((LTRResultIterator*)it)->Confidence(level));
*hocr_str += "\">";
}
You can’t perform that action at this time.