Skip to content

Instantly share code, notes, and snippets.

View IQAndreas's full-sized avatar

Andreas Renberg IQAndreas

View GitHub Profile
@IQAndreas
IQAndreas / gist:3814143
Created October 1, 2012 20:14
List of my Flixel branches
GIT/Flixel/IQAndreas-Flixel$ git branch
* FlixelCommunity-dev
IQAndreas-master
dev-generate-swc-script
dev_FlxSprite_improvements
dev_FlxSubState
dev_add_gitignore
dev_efficientInput_bak
dev_efficient_input
dev_fix_all
@IQAndreas
IQAndreas / testDefenitionPlacementPerformance.as
Created October 2, 2012 18:48
Test AS3 variable definition placement performance
private function testDefenitionPlacementPerformance(n:uint):void
{
var startTime:uint;
startTime = getTimer();
var outside:Number;
for (var i:int = 0; i < n; i++)
{
outside = Math.random();
}
$ python3 gh-issues-import/gh-issues-import.py
Traceback (most recent call last):
File "gh-issues-import/gh-issues-import.py", line 129, in <module>
main()
File "gh-issues-import/gh-issues-import.py", line 125, in main
import_issues(issues, milestones, labels)
File "gh-issues-import/gh-issues-import.py", line 103, in import_issues
res_issue = send_post_request("%s/issues" % dst_url, issue)
File "gh-issues-import/gh-issues-import.py", line 22, in send_post_request
response = urllib.request.urlopen(req)

IQAndreas: What is the name for a "not scripting language"? (e.g. AS3, Java)

leichtgewicht: imho this describes the just use:

  • scripted - changeable at runtime (eval)
  • interpreted - to byte code (as3)
  • compiled - to machine code

IQAndreas: Perhaps I'm using "scripting language" incorrectly. Take for instance PHP or Shell which run from start to finish, then stop. AS3 or Java code typically "stay alive" and run code "continuously". What is the proper name for that?

@IQAndreas
IQAndreas / log.as
Created January 4, 2013 07:41
Log data to both JavaScript and ActionScript (useful for switching between testing in the IDE and testing on the server)
package
{
import flash.external.ExternalInterface;
/** Will send the text to trace and JavaScript console (if available)
* Only to be used for debugging. Not to be used for final release! */
public function log(... args):String
{
// Log a blank line if nothing is passed
var str:String = (args.length > 0) ? args.join(" ") : "-----------------------------------";
@IQAndreas
IQAndreas / make-all-utils-executable.sh
Created January 7, 2013 19:22
Make all files in the "utils" folder executable
for f in utils/*; do chmod +x "$f"; done
#!/bin/bash
if [ $# -lt 1 ]; then
echo "[clear-git-directory.sh] Please specify the GIT repository to clear."
exit 1;
elif [ ! -d "$1/.git" ]; then
echo "[clear-git-directory.sh] Cannot find a GIT repository in '$1'."
exit 1;
else
cd "$1";
$ telnet jw.org 80
Trying 54.246.51.69...
Connected to jw.org.
Escape character is '^]'.
GET / HTTP/1.0
HTTP/1.1 403 Forbidden
Server: Varnish
Content-Type: text/html; charset=utf-8
Content-Length: 318
$ svn checkout -r 958 https://eventlist.svn.sourceforge.net/svnroot/eventlist/trunk
svn: E195012: Unable to find repository location for 'https://eventlist.svn.sourceforge.net/svnroot/eventlist/trunk' in revision 958
@IQAndreas
IQAndreas / gist:4579236
Created January 20, 2013 15:01
Odd but valid syntax for retrieving keys or values from an object
// Originally by @pleclech
// via http://pastebin.com/1MDyFVJA
var o:Object = { foo:"bar", hello:"world", one:"one", two:"two" };
var values:Array = [];
for each (values[values.length] in o);
trace(values); // world,one,two,bar
var keys:Array = [];