Skip to content

Instantly share code, notes, and snippets.

View wayneseymour's full-sized avatar
💭
ABC...always be coding :)

Tre' wayneseymour

💭
ABC...always be coding :)
View GitHub Profile
@justintv
justintv / .bashrc
Created August 17, 2009 00:53
Display git branch in bash prompt
# If you work with git, you've probably had that nagging sensation of not knowing what branch you are on. Worry no longer!
export PS1="\\w:\$(git branch 2>/dev/null | grep '^*' | colrm 1 2)\$ "
# This will change your prompt to display not only your working directory but also your current git branch, if you have one. Pretty nifty!
# ~/code/web:beta_directory$ git checkout master
# Switched to branch "master"
# ~/code/web:master$ git checkout beta_directory
# Switched to branch "beta_directory"
@un33k
un33k / sed cheatsheet
Created August 22, 2011 13:28
magic of sed -- find and replace "text" in a string or a file
FILE SPACING:
# double space a file
sed G
# double space a file which already has blank lines in it. Output file
# should contain no more than one blank line between lines of text.
sed '/^$/d;G'
@ryanflorence
ryanflorence / jshint-and-vim.md
Created November 2, 2011 18:29
Get jshint running on write (save) with VIM
  1. Download [jshint.vim][jshint]

  2. Put it in ~/.vim/plugin/jshint.vim

  3. Edit your local vimrc file (I'm on macvim with janus, so it's at ~/.gvimrc.local) and add:

    au BufWritePost *.js :JSHint
  4. Read the [vim docs][vim] and particularly [auto commands][auto] I'm a newb and the neckbeards are probably laughing at me for even posting this.

@nazgob
nazgob / ctags.setup
Created January 6, 2012 13:44
ctags setup on mac
# you have ctags but it does not work...
$ ctags -R --exclude=.git --exclude=log *
ctags: illegal option -- R
usage: ctags [-BFadtuwvx] [-f tagsfile] file ...
#you need to get new ctags, i recommend homebrew but anything will work
$ brew install ctags
#alias ctags if you used homebrew
$ alias ctags="`brew --prefix`/bin/ctags"
@joelambert
joelambert / ddns.php
Created May 9, 2012 08:16
Update DNS Made Easy DDNS Record with Local IP
#!/usr/bin/php
<?php
/**
* Update DNS Made Easy DDNS Record with Local IP
* http://www.joelambert.co.uk
*
* Copyright 2012, Joe Lambert.
* Free to use under the MIT license.
* http://joelambert.mit-license.org/
*/
@joseraya
joseraya / snapshot-crawler.js
Created January 21, 2014 20:15
A node script that crawls a web site and stores snapshots (taken with zombie.js) to the file system. Based on code from this article: http://www.ng-newsletter.com/posts/serious-angular-seo.html
var Browser = require('zombie'),
url = require('url'),
fs = require('fs'),
$q = require('Q'),
saveDir = __dirname + '/_snapshots';
var scriptTagRegex = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;
var stripScriptTags = function(html) {
alias c='pushd'
alias d='popd'
alias cdev='c ~/dev > /dev/null'
alias cdown='c /Users/wayne/Downloads > /dev/null'
alias cfs='c /Users/wayne/dev/lrn/node/rest/fake-service > /dev/null'
alias cl='clear'
alias cll='cl; ll'
alias ea='c ~ > /dev/null; vim .bash_profile; d > /dev/null'
alias gb='git branch'
alias gs='cl; git status'
@staltz
staltz / introrx.md
Last active May 30, 2024 01:44
The introduction to Reactive Programming you've been missing
@massahud
massahud / Portable Node.js andNPM on windows.md
Last active May 24, 2024 14:51
Portable Node.js and NPM on windows
  1. Get node binary (node.exe) from http://nodejs.org/download/
  2. Create the folder where node will reside and move node.exe to it
  3. Download the last zip version of npm from http://nodejs.org/dist/npm
  4. Unpack the zip inside the node folder
  5. Download the last tgz version of npm from http://nodejs.org/dist/npm
  6. Open the tgz file and unpack only the file bin/npm (without extension) directly on the node folder.
  7. Add the the node folder and the packages/bin folder to PATH
  8. On a command prompt execute npm install -g npm to update npm to the latest version

Now you can use npm and node from windows cmd or from bash shell like Git Bash of msysgit.

@DrBoolean
DrBoolean / free-er.js
Last active March 17, 2024 10:33
Free(er) monads in JS (pt 1)
const daggy = require('daggy')
const compose = (f, g) => x => f(g(x))
const id = x => x
const kleisli_comp = (f, g) => x => f(x).chain(g)
//=============FREE=============
const Free = daggy.taggedSum({Impure: ['x', 'f'], Pure: ['x']})
const {Impure, Pure} = Free