View Dockerfile
FROM eclipse/stack-base:ubuntu
ENV DOCKER_COMPOSE_VERSION 1.14.0
RUN apt-get update && apt-get install -q -y wget curl python; \
curl -sSL https://get.docker.com/ | sh; \
curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose; \
chmod +x docker-compose; \
mv docker-compose /usr/local/bin/;
View sample.screenrc
# look and feel
#caption always "%{= bb}%{+b w}%h %=%{=b rw} %l %{= db} ${USER}%S@%H %{= dg}%c"
caption always "%{.bW}%-w%{.rW}%n %t%{-}%+w %=%H %Y-%m-%d %c %p.%S"
#hardstatus alwayslastline "%-Lw%{= BW}%50>%n%f* %t%{-}%+Lw%<"
# skip the startup message
startup_message off
# go to home dir
#chdir
View laravel-model_connection.sublime-snippet
<!-- Laravel Model custom connection -->
<snippet>
<content><![CDATA[
/**
* Connection type for model
* @var string
*/
protected \$connection = '${1:name_of_connection}';
]]></content>
<tabTrigger>laravel:connection</tabTrigger>
View strip_accents.rb
# encoding: utf-8
String.class_eval do
def strip_accents
accents = {
['à','À','','','ã','Ã','á','Á','','','ă','Ă','','','','','','','','','','','â','Â','','','','','','','','','',''] => 'a',
['đ','Đ'] => "d",
['è','È','','','','','é','É','','','ê','Ê','','','','','','','ế','','',''] => "e",
['ì','Ì','','','ĩ','Ĩ','í','Í','',''] => 'i',
['ò','Ò','','','õ','Õ','ó','Ó','','','ô','Ô','','','','','','','','','','','ơ','Ơ','','','','','','','','','',''] => "o",
View gist:7ce3519ffe71ff23fde5c922109022ee
if( strpos( $_SERVER['REQUEST_URI'], 'reviews' ) !== false ) // Check if url contains 'reviews'
$uribits = explode("/",$_SERVER['REQUEST_URI']); 'explode uri'
$operator_slug = $uribits[3]; 'get operator name from exploded uri'
header('Location: http://www.superfreeslotgames.com/mobile/reviews'.$operator_slug.$subid_url ); // new redirect
} else {
header('Location: http://www.superfreeslotgames.com/mobile/'.$subid_url ); // default to standard redirect
}
View ExcelResetUsedRange
If your Microsoft Excel scroll bars scroll for a lot of cells, but you have a small amount of data, it is likely the used range needs to be reset.
Press Ctrl+End. If this doesn't jump to the end of your data, then follow the below guide:
To reset the used range in Excel, find the end of your data, then delete all the columns to the right, and all the rows below.
Press Alt+F11 to go to Microsoft Visual Basic, then press Ctrl+G to bring up the Immediate window.
In the Immediate window, type: `ActiveSheet.UsedRange` then hit Enter.
This will make Excel re-check the used range. Press Ctrl+End again and Excel will now jump to the end of your data.
View node-and-npm-in-30-seconds.sh
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
View node-and-npm-in-30-seconds.sh
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
View forecaster.sql
--
-- PostgreSQL database dump
--
--
-- TOC entry 185 (class 1255 OID 5154394)
-- Name: in_month(date, date); Type: FUNCTION; Schema: public; Owner: -
--
CREATE FUNCTION in_month(d date, month_start date) RETURNS boolean
View Open to Noisili tab and play first combo.scpt
tell application "Google Chrome"
activate
set tabfound to false
if (exists window 1) then
set i to 0
repeat with t in (tabs of window 1)
set i to i + 1
if title of t is "Noisli - Improve Focus and Boost Productivity with Background Noise" then
set (active tab index of window 1) to i