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/env python3 | |
""" Cleaning script based on .gitignore file, the 'find' and 'rm' command. | |
It removes files with .gitignore pattern. | |
This script reads the .gitignore file, parses the patterns found there to a | |
shell remove command and then executes it. | |
- With the 'dirs' option it also removes directories. | |
- With the 'debug' option it just prints the command it would execute and exits. |
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
#Newbie programmer | |
def factorial(x): | |
if x == 0: | |
return 1 | |
else: | |
return x * factorial(x - 1) | |
print factorial(6) | |
#First year programmer, studied Pascal |
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/sh | |
# Pre-commit hook that crushes PNG files in order to reduce their size. | |
if ! which -s pngcrush | |
then | |
echo "Please install pngcrush to reduce png images size before commit" | |
exit 1; | |
fi | |
for file in `git diff --cached --name-only | grep ".png\$"` |
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
#compdef mvn | |
_mvn_targets () { | |
local -a commands | |
commands=('jetty\:run:Run Jetty from the current context.' 'validate:validate the project is correct and all necessary information is available' 'compile:compile the source code of the project' 'test:test the compiled source code using a suitable unit testing framework. These tests should not require the code be packaged or deployed' 'package:take the compiled code and package it in its distributable format, such as a JAR.' 'integration-test:process and deploy the package if necessary into an environment where integration tests can be run' 'verify:run any checks to verify the package is valid and meets quality criteria' 'install:install the package into the local repository, for use as a dependency in other projects locally' 'deploy:done in an integration or release environment, copies the final package to the remote repository for sharing with other developers and projects.' 'clean:remove all files generated by the previous build') | |
_describe -t commands |
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
// Newbie programmer | |
int factorial_newbie(int n) { | |
if (n == 0) { | |
return 1 | |
} else { | |
return n * factorial_newbie(n - 1) | |
} | |
} | |
println factorial_newbie(6) |
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
/* | |
* Copyright (c) 2009-2017, Farooq Mela | |
* All rights reserved. | |
* | |
* Redistribution and use in source and binary forms, with or without | |
* modification, are permitted provided that the following conditions are met: | |
* | |
* 1. Redistributions of source code must retain the above copyright | |
* notice, this list of conditions and the following disclaimer. | |
* 2. Redistributions in binary form must reproduce the above copyright |
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/zsh | |
# Copyleft 2010 paradoxxxzero All wrongs reserved | |
# With contribution from James Ahlborn | |
# https://gist.github.com/752727 | |
# Fork of https://gist.github.com/586698 by nicoulaj / dingram / roylzuo ... | |
# From http://www.zsh.org/mla/users/2010/msg00692.html | |
# Token types styles. | |
# See http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#SEC135 |
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
# First do a fresh install of CentOS 5.7 i386, server configuration (no GUI) | |
# This should be performed as root since it's going to be installing a bunch of stuff | |
# --- Update things to make sure we have the latest patches --- | |
# Add EPEL so we can get reasonably recent packages | |
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm | |
# --- Install all the packages --- # | |
yum -y install python-whisper python-carbon graphite-web python-memcached python-ldap httpd memcached |
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
[global_config] | |
title_transmit_bg_color = "#839496" | |
title_inactive_fg_color = "#93a1a1" | |
title_transmit_fg_color = "#eee8d5" | |
title_inactive_bg_color = "#586e75" | |
[keybindings] | |
[profiles] | |
[[default]] | |
palette = "#073642:#d30102:#859900:#b58900:#6c71c4:#d33682:#2aa198:#839496:#586e75:#cb4b16:#859900:#b58900:#268bd2:#d33682:#2aa198:#93a1a1" | |
login_shell = True |
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 java.lang.instrument.Instrumentation; | |
import java.lang.reflect.Array; | |
import java.lang.reflect.Field; | |
import java.lang.reflect.Modifier; | |
import java.security.AccessController; | |
import java.security.PrivilegedAction; | |
import java.util.IdentityHashMap; | |
public class ObjectSizer { | |
private static Instrumentation instrumentation; |
OlderNewer