#Mac OS X
This file contains hidden or 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 | |
# PRECONDITIONS | |
# virtualenv | |
# virtualenv -> http://flask.pocoo.org/docs/installation/#virtualenv | |
makeapp () { | |
{ |
This file contains hidden or 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/env ruby | |
# Usage: gitio URL [CODE] | |
# | |
# Turns a github.com URL | |
# into a git.io URL | |
# | |
# Copies the git.io URL to your clipboard. | |
url = ARGV[0] | |
code = ARGV[1] |
This file contains hidden or 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
# \u Username | |
# \w Current directory | |
# \d Date | |
# \D{fmt} Date as sprintf | |
# \h Subdomain | |
# \H Full hostname | |
# Get more colors from archlinux wiki color bash prompt | |
function proml { | |
local BLUE="\[\033[0;34m\]" |
This file contains hidden or 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
! Write a program that evals the following operations and show then in | |
! the screen | |
a = 8 / 2 | |
b = 6 / 10 | |
c = (6 + 8) / 5 | |
d = 4 * 5 / 3 * 2 | |
e = (4 * 5) / (3 / 2) | |
f = (4 * (5 / 3) / 2) | |
write (*,*) '8 / 2 =>' , a |
This file contains hidden or 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
It's not immediately clear from the context_set() function how to trigger a context to be "active" using code. Do it like this: | |
Source: http://snipplr.com/view/58723/trigger-a-drupal-context-programatically/ |
This file contains hidden or 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
! gfortran 1.f90 | |
program main | |
implicit none | |
integer :: a | |
integer :: n | |
print *, 'Insert the value of a: ' | |
read (*, *) a | |
n = 7 | |
if (mod(a, n) == 0) then |
This file contains hidden or 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
FORTRAN_COMPILER=gfortran | |
all: | |
$(FORTRAN_COMPILER) problem-set-3.f90 -o problem-set-3 | |
clean: | |
rm problem-set-3 |
This file contains hidden or 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 | |
from PIL import Image | |
import sys | |
if len(sys.argv) >= 2: | |
image_file = sys.argv[1] | |
try: | |
img = Image.open(image_file) | |
width, height = img.size |
This file contains hidden or 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
numbers = [5, 7, 8, 6, 4] | |
values = [] | |
#5 6 7 4 8 | |
#6 5 7 4 8 | |
def is_integer(n, p, q, r, s): | |
if ((n + p - q) * r) % s == 0: | |
return True |