Skip to content

Instantly share code, notes, and snippets.

View larzconwell's full-sized avatar

Larz Conwell larzconwell

View GitHub Profile
this.toObj = function () {
var obj = {};
for (var p in this) {
// For some reason if this has more than one if statement
// or if the if is checking more than one thing via "||" it
// completely ignores it and assumes it's true
if (typeof this[p] != 'function') {
obj[p] = this[p];
}
export GOROOT="$HOME/.go" # Go build
[[ ! "$PATH" =~ "$GOROOT" ]] && export PATH="$PATH:$GOROOT/bin" # Add bin to path
export GOPATH="$HOME/Programming/Go" # Go project path
var reverse = function(array) {
var i = array.length
, arr = [];
while(--i >= 0) {
arr.push(array[i])
}
return arr;
}
package main
import (
"fmt"
)
func Reverse(slice []string) []string {
ret := make([]string, len(slice), cap(slice))
for i := len(slice) - 1; i >= 0; i-- {
{
"env": {
// Go executable, stdlib, etc
"GOROOT": "$HOME/.go"
// Custom packages, and packages installed from go get and go install
"GOPATH": "$HOME/Programming/go"
}
}
package main
import (
"flag"
"fmt"
"os"
"os/exec"
"time"
)
// Style 1
var config = {
spdy: true,
ssl: {
key: '/home/larz/Desktop/server.key',
cert: '/home/larz/Desktop/server.crt'
}
};
module.exports = config;
<?php
// Get the "API_SECRET" variable from our shell session
$api_secret = getenv('API_SECRET');
// Same as above, but using a Superglobal
$api_secret = $_ENV['API_SECRET'];
// You can use phpinfo to show all the environmental variables you can use.
phpinfo(INFO_ENVIRONMENT);
#!/bin/bash
echo -e "Hi, I'm Douglas Crockford. Do you have an issue or a pull request?\n"
ask() {
read Type
if [[ "$Type" =~ "request" ]]; then
echo "You have the source."
elif [[ "$Type" =~ "issue" ]]; then
-- For use with the ComputerCraft Minecraft mod. http://computercraft.info/
--
-- To use, just get a mining turtle then create a script
-- do: edit miner
-- then write this script(I know, tedious).
-- Once finished just do `miner` to start finding diamonds!
-- Keeps track of up and down movements
downCounter = 0
upCounter = 0