Skip to content

Instantly share code, notes, and snippets.

@scottgwald
scottgwald / myip.sh
Last active August 29, 2015 14:27
get ip address on local 192 network (cross-platform is TODO, mac os x for now)
#! /bin/bash
ipline=$(ifconfig | grep inet | grep " 192")
ip=$(echo $ipline | sed 's/inet \([^ ]*\).*/\1/g')
echo $ip
@GochoMugo
GochoMugo / Readme.md
Last active January 18, 2016 11:41
Mackup configuration file for Remindme

Once you have created a remindme.cfg with the contents as shown in the file, place it in ~/.mackup.

Now, trigger a backup:

$ mackup backup
@CMCDragonkai
CMCDragonkai / cygwin_or_mingw.sh
Created March 31, 2016 12:50
CLI: Detect Cygwin or MINGW
#!/usr/bin/env bash
case "$(uname --kernel-name)" in
*cygwin*|*CYGWIN*|*mingw*|*MINGW*|*msys*|*MSYS*)
echo "I'm in cygwin or mingw!"
;;
esac
@fredriks
fredriks / gist:ac7f955a19ad49d8ee82
Last active December 16, 2018 02:43
Build vim 7.4 with lua support - Ubuntu 14.04 (Trusty)
# Remove previous installations
sudo apt-get remove vim vim-runtime vim-tiny vim-common
# Install dependencies
sudo apt-get install libncurses5-dev python-dev libperl-dev ruby-dev liblua5.2-dev
# Fix liblua paths
sudo ln -s /usr/include/lua5.2 /usr/include/lua
sudo ln -s /usr/lib/x86_64-linux-gnu/liblua5.2.so /usr/local/lib/liblua.so
@demisx
demisx / syntax.css
Last active February 20, 2020 04:32
Syntax highlighter CSS file
.highlight { background: #ffffff; }
.highlight .c { color: #999988; font-style: italic } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { font-weight: bold } /* Keyword */
.highlight .o { font-weight: bold } /* Operator */
.highlight .cm { color: #999988; font-style: italic } /* Comment.Multiline */
.highlight .cp { color: #999999; font-weight: bold } /* Comment.Preproc */
.highlight .c1 { color: #999988; font-style: italic } /* Comment.Single */
.highlight .cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
@iamralch
iamralch / searchr.go
Created July 11, 2015 11:50
searchr - a sample application that works with pipes
package main
import (
"bufio"
"flag"
"fmt"
"io"
"os"
"strings"
)
@odlp
odlp / jasmine_seed_reporter.js
Last active March 10, 2022 20:57
Jasmine / Karma seed reporter for random test order
var SeedReporter = function(baseReporterDecorator) {
baseReporterDecorator(this);
this.onBrowserComplete = function(browser, result) {
if (result.order && result.order.random && result.order.seed) {
this.write("%s: Randomized with seed %s\n", browser, result.order.seed);
}
};
};
@nl5887
nl5887 / transfer.fish
Last active March 22, 2022 09:07
Bash and zsh alias for transfer.sh. Transfers files and directories to transfer.sh.
function transfer
if test (count $argv) -eq 0
echo "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md"
return 1
end
## get temporarily filename, output is written to this file show progress can be showed
set tmpfile ( mktemp -t transferXXX )
## upload stdin or file
@netpoetica
netpoetica / Compiling v8 and Hello, World Example on Mac OSX Mavericks (10.9.4).md
Last active August 7, 2022 09:25
Compiling v8 and Hello, World Example on Mac OSX Mavericks (10.9.4), Link Clang to Static Libraries, properly configure your environment for v8 build

Compiling v8 and Hello, World Example on Mac OSX Mavericks (10.9.4)

by Keith Rosenberg (netpoetica)

Note: do this in some sort of project/ directory that makes sense. depot_tools are going to need to be in your path, so you may want to install them somewhere you are comfortable with.

1) Get the v8 source

git clone https://github.com/v8/v8.git

2) Install depot tools

@nicolashery
nicolashery / environment-variables-jekyll-templates.md
Last active January 22, 2023 15:56
Make environment variables available in Jekyll Liquid templates

Environment variables in Jekyll templates

This is one way to pass some data (API tokens, etc.) to your Jekyll templates without putting it in your _config.yml file (which is likely to be committed in your GitHub repository).

Copy the environment_variables.rb plugin to your _plugins folder, and add any environment variable you wish to have available on the site.config object.

In a Liquid template, that information will be available through the site object. For example, _layouts/default.html could contain: