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
require "pp" | |
require "benchmark" | |
# Yea. Extremely slow and prolly Linux only | |
def mem_sampler | |
stat = GC.stat | |
stat.map do |k,v| | |
"#{k}\t#{v}" | |
end.join("\n") | |
end |
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
set -e | |
working_dir=$(pwd) | |
feature=$2 | |
action=$1 | |
now=$(date -u +"%Y-%m-%dT%H:%M:%SZ") # ISO8601 | |
echo "[$now] $working_dir $action $feature" >> ~/.git-flow-feature.log |
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
number=$1 | |
prime=true | |
#for i in {1.."$number"} | |
for i in $(seq 2 1 $(($number - 1))) | |
do | |
if [ $(($number % $i)) -eq 0 ] | |
then | |
prime=false | |
out="$out \n number $i a factor" | |
fi |
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
def flash_errors_for(model) | |
return unless model.errors.any? | |
messages = [I18n.t("errors.messages.not_saved", | |
count: model.errors.size, | |
resource: model.model_name)] | |
# Sanitize any errors | |
messages << model.errors.to_a.map(&:html_safe) | |
# assign to alert, mark as safe |
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 | |
current=$(dconf read /org/gnome/desktop/input-sources/xkb-options) | |
swapped="['caps:swapescape']" | |
capslock="['caps:capslock']" | |
echo "Current status: $current" | |
if [ "$current" == "$swapped" ] | |
then | |
echo "Making caps and escape WORK NORMALLY" |
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
import robocode.*; | |
import java.util.Random; | |
public class Marnick extends Robot { | |
boolean found = false; | |
int movingCounter = 72; | |
public void run() { | |
while (true) { | |
if(movingCounter > 0 || found) { | |
movingCounter--; |
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
/** | |
* Copyright (c) 2001-2014 Mathew A. Nelson and Robocode contributors | |
* All rights reserved. This program and the accompanying materials | |
* are made available under the terms of the Eclipse Public License v1.0 | |
* which accompanies this distribution, and is available at | |
* http://robocode.sourceforge.net/license/epl-v10.html | |
*/ | |
package sample; | |
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
package sample; | |
import java.util.Random; | |
import robocode.Robot; | |
import robocode.Rules; | |
import robocode.ScannedRobotEvent; | |
public class Klaas extends Robot { | |
private int scannedX; |
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
package EB9000; | |
import robocode.*; | |
//import java.awt.Color; | |
// API help : http://robocode.sourceforge.net/docs/robocode/robocode/Robot.html | |
/** | |
* Evilbot9000 - a robot by (your name here) | |
*/ | |
public class Evilbot9000 extends Robot |
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
/tmp/ruby-build.20150412141408.30731 /opt/rbenv | |
HTTP/1.1 200 OK | |
Content-Type: binary/octet-stream | |
Content-Length: 503012 | |
Connection: keep-alive | |
Date: Tue, 10 Feb 2015 13:45:53 GMT | |
Last-Modified: Fri, 23 May 2014 08:48:21 GMT | |
ETag: "5fe00cda18ca5daeb43762b80c38e06e" | |
Accept-Ranges: bytes | |
Server: AmazonS3 |