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 math | |
| class Reward: | |
| def __init__(self, verbose=False): | |
| self.first_racingpoint_index = 0 # None | |
| self.verbose = verbose | |
| def reward_function(self, params): | |
| # Import package (needed for heading) |
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
| from sense_hat import SenseHat | |
| import time | |
| import random | |
| sense = SenseHat() | |
| colors = [ | |
| [255, 0, 0], # Red | |
| [255, 194, 0], # Amber | |
| [255, 165, 0], # Orange | |
| [0, 0, 0] # Off |
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
| // Because I keep forgetting | |
| System.setProperty("dexmaker.dexcache", getInstrumentation().getTargetContext().getCacheDir().getPath()); |
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
| # FreeAgent puts the powerline style in zsh ! | |
| if [ "$POWERLINE_DATE_FORMAT" = "" ]; then | |
| POWERLINE_DATE_FORMAT=%D{%Y-%m-%d} | |
| fi | |
| if [ "$POWERLINE_RIGHT_B" = "" ]; then | |
| POWERLINE_RIGHT_B=%D{%H:%M:%S} | |
| elif [ "$POWERLINE_RIGHT_B" = "none" ]; then | |
| POWERLINE_RIGHT_B="" |
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 bash | |
| function main() { | |
| local simulator_size=$1 | |
| if [[ -z "$1" ]]; then | |
| simulator_size="1.0" | |
| fi | |
| defaults write ~/Library/Preferences/com.apple.iphonesimulator SimulatorWindowLastScale ${simulator_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
| #!/bin/sh | |
| # | |
| # update_storyboard_strings.sh - automatically extract translatable strings from storyboards and update strings files | |
| # Source: https://gist.github.com/marcadams/6825053 | |
| # Based on http://forums.macrumors.com/showpost.php?p=16060008&postcount=4 by mikezang | |
| storyboardExt=".storyboard" | |
| stringsExt=".strings" | |
| newStringsExt=".strings.new" | |
| oldStringsExt=".strings.old" |
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
| @GrabResolver(name='grails-core', root='http://repo.grails.org/grails/core') | |
| @Grab(group='org.grails', module='grails-datastore-gorm-mongo', version='1.0.0.BUILD-SNAPSHOT') | |
| @Grab(group='org.slf4j', module='slf4j-simple', version='1.6.1') | |
| import grails.persistence.* | |
| import org.grails.datastore.gorm.mongo.config.* | |
| MongoDatastoreConfigurer.configure("myDatabase", Book) | |
| Book.withSession { |
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
| @GrabResolver(name='grails-core', root='http://repo.grails.org/grails/core') | |
| @Grab(group='org.grails', module='grails-datastore-gorm-mongo', version='1.0.0.BUILD-SNAPSHOT') | |
| @Grab(group='org.slf4j', module='slf4j-simple', version='1.6.1') | |
| import grails.persistence.* | |
| import org.grails.datastore.gorm.mongo.config.* | |
| MongoDatastoreConfigurer.configure("myDatabase", Book) | |
| Book.withSession { |
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
| development { | |
| hibernate { | |
| cache.use_second_level_cache=false | |
| cache.use_query_cache=false | |
| cache.provider_class='net.sf.ehcache.hibernate.EhCacheProvider' | |
| } | |
| dataSource { | |
| pooled = true | |
| dbCreate = "validate" |
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
| class FacebookPaginator < WillPaginate::LinkRenderer | |
| include WillPaginate::ViewHelpers | |
| def stringified_merge(target, other) | |
| other.each do |key, value| | |
| key = key.to_s # this line is what it's all about! | |
| next if "fb_sig_friends" == key | |
| existing = target[key] | |
| if value.is_a?(Hash) and (existing.is_a?(Hash) or existing.nil?) |
NewerOlder