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 | |
# Created by Breno Lima de Freitas - 2013 | |
# based on <http://forums.linuxmint.com/viewtopic.php?f=47&t=130343> | |
# The script accepts one single optional parameter (-nd). This pa- | |
# rameter tells the script to not download the file. | |
if [ "$1" != "-nd" ]; then | |
wget https://copy.com/install/linux/Copy.tgz -O /tmp/copy.tgz | |
fi |
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
#!/usr/bin/python | |
import sys | |
from os import listdir, rename | |
from os.path import isfile, join, splitext | |
import re | |
import argparse | |
######################################################################################################################## | |
######################################################################################################################## |
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
import * from './privatize.js'; | |
let token = Symbol(); // this is a class secret! | |
export class Babel { | |
@attr_accessor // <- create getters and setters | |
@privatize(token) // <- private attributes turns into functions `fun (token, ...args)` | |
lang; | |
@attr_accessor |
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
MAX = 1500 | |
def stringfy(number) | |
text = '' | |
begin | |
remainder = number % 26 | |
text += (remainder + 'a'.ord).chr | |
number = number / 26 | |
end while number > 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
#include <stdio.h> | |
#include <stdlib.h> | |
#define MAX 100 | |
int a[MAX], b[MAX], c[MAX], n; | |
int cmp (const void *a, const void *b) { | |
return *((int*) a) - *((int*) b); | |
} |
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
let lines = []; | |
export default class Grid { | |
constructor (game, rows, columns) { | |
if (game === undefined || columns === undefined || rows === undefined) { | |
throw new TypeError(); | |
} | |
let w = Math.floor(game.width / columns); | |
let h = Math.floor(game.height / rows); |
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
'use strict' | |
// using bookshelf.js | |
const Model = require('../models/Model') | |
module.exports = class Controller { | |
static *read (request, response) { | |
const count = yield Model.org(request.organization).count() | |
response.ok() |
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
monthly_investment = 2 # x1000 | |
savings = 0 | |
years = 0 | |
while savings < 1000: | |
savings = (savings + 12 * monthly_investment) * 1.05 | |
years += 1 | |
print years, savings |
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
'use strict'; | |
// user=brenolf password='xxxxx' node crawler.js | |
const USER = process.env.user; | |
const PASSWORD = process.env.password; | |
const co = require('co'); | |
const rp = require('request-promise'); |
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 | |
PROJECT=name; | |
if [[ "$1" == "staging" || "$1" == "production" ]]; then | |
TARGET=`echo "$1" | tr '[:lower:]' '[:upper:]'`; | |
read -p "Do you really wish to deploy to $TARGET? [yn] " yn; | |
if [[ "$yn" != "y" ]]; then |
OlderNewer