Let's write better JavaScript, and the same, k?
We always use spaces, and we always use four. Set your editor now.
function myFunction() {
function fuck() { | |
if killall -9 "$2"; then | |
echo ; echo " (╯°□°)╯︵$(echo "$2"|toilet -f term -F rotate)"; echo | |
fi | |
} |
#!/bin/sh | |
# Store git files in a different directory than the repo | |
git --work-tree=/var/www/meatspace-markov-memeify --git-dir=/var/repos/meatspace-markov-memeify/app.git checkout -f | |
# Install npm deps | |
cd /var/www/meatspace-markov-memeify && npm install | |
# If index.js is running, restart--otherwise start! | |
forever restart --spinSleepTime 10000 --minUptime 1000 /var/www/meatspace-markov-memeify/index.js --port=8000 || forever start --spinSleepTime 10000 --minUptime 1000 /var/www/meatspace-markov-memeify/index.js --port=8000 |
console.lol = function() { | |
var harray = [], harrumpf = Math.floor( Math.random() * 10 + 2 ); | |
while ( harrumpf-- ) harray.push( 'ha' ); | |
console.log( harray.join( '' ) + '!' ); | |
} |
# In ~/.bash_profile or ~/.profile, whichever you use | |
alias gut="git" | |
# In ~/.gitconfig | |
[alias] | |
punch = push | |
# Or maybe more acccurately | |
[alias] | |
punch = push -f |
#!/bin/bash | |
# Usage: $0 username | |
# e.g.: | |
# $ ./twitter_user_to_image coates | |
# https://si0.twimg.com/profile_images/1597362183/me.jpg | |
curl -sL http://twitter.com/$1 | grep profile_images | head -n1 | perl -p -e's/.*?http/http/;s/".*//;s/_bigger//' |
exec { "change_httpd_user": | |
command => "sed -i 's/www-data/vagrant/g' /etc/apache2/envvars", | |
onlyif => "/bin/grep -q 'www-data' '/etc/apache2/envvars'", | |
notify => Service['apache2'], | |
require => Package['apache2'], | |
} | |
file { "/var/lock/apache2": | |
ensure => "directory", | |
owner => "vagrant", |
<?php | |
class A | |
{ | |
public static $var = "I'm set in A!<br>"; | |
public static function getStatic() { | |
echo static::$var; | |
} | |
public static function getSelf() { |
#!/bin/bash | |
# args | |
MSG=${1-'deploy from git'} | |
BRANCH=${2-'trunk'} | |
# paths | |
SRC_DIR=$(git rev-parse --show-toplevel) | |
DIR_NAME=$(basename $SRC_DIR) | |
DEST_DIR=~/svn/wp-plugins/$DIR_NAME/$BRANCH |