Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
n=0; ls -tr | while read i; do n=$((n+1)); mv -- "$i" "$(printf '%03d' "$n").JPG"; done
[[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
export NVM_DIR="$HOME/.nvm"
. "$(brew --prefix nvm)/nvm.sh"
# Git-bash-prompt
if [ -f "$(brew --prefix bash-git-prompt)/share/gitprompt.sh" ]; then
[Unit]
Description=Download IP Geolocation Database from Maxmind.com
[Service]
Type=oneshot
WorkingDirectory=/tmp
ExecStart=/bin/sh -c "\
mkdir -p /home/core/ip_database \
curl -O http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz ; \
gunzip GeoLite2-City.mmdb.gz ; \
curl -O http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.md5 ; \
@Andsbf
Andsbf / git_ignore_ds_store.md
Last active December 3, 2015 22:15
Make Git always ignore .DS_store file

Make Git never ask you again about .DS_Store

In the terminal:

echo .DS_Store > ~/.gitignore_global

Now tell git to use it for all repositories:

git config --global core.excludesfile ~/.gitignore_global

@Andsbf
Andsbf / 01_hello_world.js
Last active August 29, 2015 14:19
Learnyounode - I
console.log("HELLO WORLD")
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Bet game</title>
<meta name="description" content="Bet gamed">
<meta name="author" content="Anderson">
</head>
var output = []
var arrayOfLight = function (x) {
for (i = 0; i <= x; i++){
output.push(i);
}
return output;
@Andsbf
Andsbf / FailingIfStatement.js
Last active August 29, 2015 14:18
W6D1 Debugging Exercises
// Why does this fail?
var a = 0;
//if comparator was using equal only '='
if (a === 1) {
console.log("I Shouldn't be in here!");
} else {
console.log("I Should be in here!");
}
@Andsbf
Andsbf / Select_statments.sql
Created March 17, 2015 04:23
Bookstore SQL Assignment
-- double dash is comment in SQL
--################ Exercise 5 ################
SELECT e.isbn, b.title, s.stock, s.retail,
CASE e.type
WHEN 'p' THEN 'Paperback'
WHEN 'h' THEN 'Hardcover'
END AS cover
FROM editions AS e INNER JOIN publishers AS p ON (e.publisher_id = p.id)
@Andsbf
Andsbf / comment.rb
Last active August 29, 2015 14:16
Web Scrapper Exercise
class Comment
attr_accessor :content
def initialize (content)
@content = content
end
end