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
local ActionKey = display.newRect(controlGroup, DpadBack.x + 750, DpadBack.y - 37, 100, 100) | |
local function move( event ) | |
if event.phase == "ended" or event.phase == "cancelled" then | |
movement = nil | |
elseif player.talking then | |
return false; | |
elseif event.target.id then | |
movement = event.target.id | |
player.lastMovement = event.target.id |
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
--DETECT OBSTACLES ------------------------------------------------------------ | |
local obstacle = function(level, locX, locY) | |
local detect = mte.getTileProperties({level = level, locX = locX, locY = locY}) | |
for i = 1, #detect, 1 do | |
-- I forget why I check the tile property... | |
if detect[i].tile then | |
-- does its layers property solid? | |
if layers[i].properties and layers[i].properties.solid and detect[i].tile > 0 then | |
detect = "stop" | |
player:pause() |
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
if(keyboard_check(vk_nokey)) { | |
image_speed = 0; | |
} | |
if(keyboard_check(vk_left)) { | |
sprite_index = spr_right; | |
image_speed = 0.2; | |
image_xscale= 1; | |
x -= 4; | |
} |
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
$('.bt-request-buffed').each( | |
function(index, value) { var el = $(this); var alpha = Math.floor((Math.random() * 8) + 3); setTimeout(function() { el.trigger('click'); }, (index * alpha) * 2500); }); | |
/* Alternatively, you might try (index + alpha) * 1000 for a more natural sequence */ |
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
# pip install gmaps | |
import gmaps | |
""" Earthquake Example """ | |
earthquake_data = gmaps.datasets.load_dataset('earthquakes') | |
earthquake_data[:5] | |
m = gmaps.heatmap(earthquake_data, max_intensity=10, point_radius=5) | |
# Set max_intensity to avoid a few strong earthquakes drowning out all the smaller ones. |
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
find . -name "*.txt" -exec cat {} \; | tr " " "\n" | wc -l |
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 | |
EXITCODE=0 | |
# CVE-2014-6271 | |
CVE20146271=$(env 'x=() { :;}; echo vulnerable' 'BASH_FUNC_x()=() { :;}; echo vulnerable' bash -c "echo test" 2>&1 | grep 'vulnerable' | wc -l) | |
echo -n "CVE-2014-6271 (original shellshock): " | |
if [ $CVE20146271 -gt 0 ]; then | |
echo -e "\033[91mVULNERABLE\033[39m" | |
EXITCODE=$((EXITCODE+1)) |
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 nltk | |
from nltk.collocations import * | |
bigram_measures = nltk.collocations.BigramAssocMeasures() | |
trigram_measures = nltk.collocations.TrigramAssocMeasures() | |
# change this to read in your data | |
finder = BigramCollocationFinder.from_words( | |
nltk.corpus.genesis.words('/var/www/htdocs/rapstats/data/albums/wutang_all.txt')) | |
# only bigrams that appear 3+ times |
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
history | awk '{print $2}' | awk 'BEGIN {FS="|"}{print $1}' | sort | uniq -c | sort -n | tail | sort -nr |
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
if [ `id -u` != 0 ]; then | |
echo "This script must be run as root" 1>&2 | |
exit 1 | |
fi |
OlderNewer