This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"os" | |
"github.com/asaskevich/govalidator" | |
// my pretend module with some translation logic | |
"github.com/my/translations" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" /> | |
<script src="https://unpkg.com/[email protected]/dist/leaflet.js"></script> | |
<style id="jsbin-css"> | |
#map { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Extensions; | |
// we have an Eloquent model that allows using the session table with the querybuilder methods and eloquent fluent interface- read only! | |
use App\Session; | |
// use the provided database session handler to avoid too much duplicated effort. | |
use Illuminate\Session\DatabaseSessionHandler; | |
class AppDatabaseSessionHandler extends DatabaseSessionHandler |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install GCC 4.7.3 | |
sudo apt-add-repository ppa:ubuntu-sdk-team/ppa | |
sudo apt-get update | |
sudo apt-get install -y build-essential | |
# Install CMake 2.8.10.1 | |
sudo apt-get install -y cmake cmake-curses-gui | |
wget ftp://ftp.lyx.org/pub/linux/distributions/0linux/archives_sources/opencv/opencv-2.4.5.tar.gz | |
tar -xf opencv-2.4.5.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$path = __DIR__ . DIRECTORY_SEPARATOR . ltrim(parse_url($_SERVER['REQUEST_URI'])['path'], '/'); | |
if (file_exists($path) && !is_dir($path)) { | |
return false; | |
} | |
if (file_exists($path . '/index.php')) { | |
require $path . '/index.php'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
RBENV_LOC=$HOME/.rbenv | |
if [ -d $RBENV_LOC ]; then | |
rm -rf $RBENV_LOC | |
fi | |
echo 'Cloning rbenv...' | |
git clone --depth 1 -q https://github.com/rbenv/rbenv.git $RBENV_LOC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
puts "How many times do you want to roll?" | |
choice = gets.chomp | |
puts "How many sides should dice have?" | |
sides = gets.chomp | |
c = choice.to_i | |
s = sides.to_i | |
# store our tally of results in a hash with a default value | |
# for uninitialized members of 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pete@pete-laptop ~/projects/pikelets % node -v | |
v0.12.7 | |
pete@pete-laptop ~/projects/pikelets % npm install git://github.com/rwaldron/johnny-five.git | |
> [email protected] postinstall /home/pete/projects/node_modules/johnny-five/node_modules/firmata | |
> node scripts/postinstall | |
/ | |
> [email protected] install /home/pete/projects/node_modules/johnny-five/node_modules/firmata/node_modules/serialport | |
> node-pre-gyp install --fallback-to-build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SET FOREIGN_KEY_CHECKS = 0; | |
TRUNCATE TABLE `catalog_category_entity`; | |
TRUNCATE TABLE `catalog_category_entity_datetime`; | |
TRUNCATE TABLE `catalog_category_entity_decimal`; | |
TRUNCATE TABLE `catalog_category_entity_int`; | |
TRUNCATE TABLE `catalog_category_entity_text`; | |
TRUNCATE TABLE `catalog_category_entity_varchar`; | |
TRUNCATE TABLE `catalog_category_product`; | |
TRUNCATE TABLE `catalog_category_product_index`; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#config/routes.rb | |
Rails.application.routes.draw do | |
get '/surveys', to: 'surveys#show' | |
end |
NewerOlder