Skip to content

Instantly share code, notes, and snippets.

@bencooling
bencooling / Server: robots.txt
Created May 14, 2013 03:04
Server: robots.txt
// Create robots file
$ touch robots.txt
// Block all robots
User-agent: *
Disallow: /
// Block a single page
Disallow: /private_file.html
@bencooling
bencooling / README.md
Last active December 17, 2015 12:29 — forked from lovasoa/README.md
Javascript: array_intersect function for intersecting many arrays

javascript: array_intersect

Fastest function to intersect a large number of big arrays in javascript, without dependencies

  • The compressed version is only 345 caracters long.
  • Faster than common libraries, even a large number of arrays, or on very big arrays. (See benchmarks)
usage
array_intersect(array1, array2, ..., arrayN)
@bencooling
bencooling / php.ini
Last active December 19, 2015 03:19
Various php.ini directives
; Set correct timezone
date.timezone = "Australia/Brisbane"
; Prevent corrupted php execution with php-fpm
cgi.fix_pathinfo=0
@bencooling
bencooling / .bash_profile
Last active December 19, 2015 06:49
Bash: ubuntu configuration files
# ubuntu .bash_profile
#---------------------------------
# Environment Variables
#---------------------------------
export PS1="\h \w:"
export NOW=$(date +"%Y-%m-%d")
export PATH=$PATH:$HOME/bin
# Aliases
@bencooling
bencooling / .bash_profile
Last active December 19, 2015 06:49
nginx: mac osx setup
export SHARE="/usr/share/php/var"
alias phpfpm-start="sudo $(brew --prefix josegonzalez/php/php55)/sbin/php-fpm"
alias phpfpm-stop="sudo kill $(cat $SHARE/run/php-fpm.pid)"
alias phpfpm-log="tail -f $SHARE/log/php-fpm.log"
@bencooling
bencooling / mixins.scss
Last active December 19, 2015 08:19
Sass: mixins
@mixin box-emboss($opacity, $opacity2){
box-shadow:white($opacity) 0 1px 0, inset black($opacity2) 0 1px 0;
}
/*
.box { @include box-emboss(0.8, 0.05); }
*/
@mixin letterpress($opacity){
text-shadow:white($opacity) 0 1px 0;
@bencooling
bencooling / README.md
Last active December 19, 2015 09:29
PHP: boilerplate code for php libraries Swiftmailer, Illuminate

##php: boilerplate code for various php libraries Sample php code for php libraries found in packagist

  • Swiftmailer
@bencooling
bencooling / Gruntfile.js
Last active December 19, 2015 19:38
Node & NPM, Grunt.
(function () {
'use strict';
module.exports = function(grunt) {
// Plugins
grunt.loadNpmTasks('grunt-contrib-requirejs');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-clean');
@bencooling
bencooling / READEME.md
Last active December 20, 2015 00:39
shell scripts

shell scripts

Various shell scripts

Class Generator

Includes the following files for creating class files in Windows environment:

  • classGenerator.php
  • classGenerator.bat
  • downloadLatestFiles.sh
@bencooling
bencooling / sqlite3.sh
Created July 23, 2013 11:53
sqlite3 commands
# Open database
sqlite3 mydata.db
# Select rows from table
SELECT * from memos;
# Delete table
DROP TABLE memos;
# Truncate table (Delete every row)