Skip to content

Instantly share code, notes, and snippets.

# METEOR CORE:
Anywhere: Meteor.isClient
Anywhere: Meteor.isServer
Anywhere: Meteor.startup(func)
Anywhere: Meteor.absoluteUrl([path], [options])
Anywhere: Meteor.settings
Anywhere: Meteor.release
@xxronis
xxronis / fillbucket
Created March 8, 2015 14:24
auto bitbucket create repo in dir and push
#!/bin/sh
# Makes a non git directory to a new private bitbucket repository with all files added to initial commit
# Usage = fillbucket <username> <password> <reponame>
git init
git add -A .
git commit -m "Initial commit"
curl --user $1:$2 https://api.bitbucket.org/1.0/repositories/ --data name=$3 --data is_private='true'
git remote add origin https://hannesr@bitbucket.org/$1/$3.git
git push -u origin --all
# cd .. with multiple jumps or jump up to name
..() {
if [ "-" == "$1" ]; then cd -; return; fi; # return to previous directory
if [ "/" == "$1" ]; then cd /; pwd; return; fi; # jump to root
if [ -z "$1" ]; then cd ../; pwd; return; fi; # jump up one
declare -i count=$1; # get a jump count
if [ $count -eq 0 ]; then # wasn't a number, look for name
local go=$(while [[ "/" != "$PWD" && "$(basename $PWD)" != "$1" ]]; do cd ..; done; pwd);
# jump up to named directory, or don't move if name wasn't found
if [ "/" != "$go" ]; then cd $go; else return; fi;
@xxronis
xxronis / apt-get
Created November 3, 2014 10:53
See what apt-get will upgrade
sudo apt-get update && sudo apt-get --just-print upgrade
@xxronis
xxronis / .bashrc
Created September 2, 2014 12:39
Colorize less output, Debian
export LESS='-R'
export LESSOPEN='|~/.lesscolors %s'
@xxronis
xxronis / locale.bash
Created September 1, 2014 19:14
fix locale ubuntu
export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
locale-gen en_US.UTF-8
dpkg-reconfigure locales
The dpkg-reconfigure locales command will open a dialog under Debian for selecting the desired locale.
This dialog will not appear under Ubuntu. The Configure Locales in Ubuntu article shows how to find
@xxronis
xxronis / apc.ini
Created August 28, 2014 08:58
enable apc for cli use
apc.cli_enable = 1
@xxronis
xxronis / callback_theme.php
Created April 11, 2014 18:46
theme a page output in D7
<?php
/**
* Menu callback.
*/
function menu_callback() {
$output = array(
'#content' => array(
'top_text' => 'Top'
'par1' => 'content-var',
'par2' => 'content2-var',
<?php
/**
* Implements hook_menu().
*/
function module_menu() {
$items = array();
$items['admin/config/site/module'] = array(
'title' => 'Module configuration',
'description' => 'Module settings form.',