Skip to content

Instantly share code, notes, and snippets.

View michaelcontento's full-sized avatar

Michael Contento michaelcontento

View GitHub Profile
set rnu
au InsertEnter * :set nu
au InsertLeave * :set rnu
au FocusLost * :set nu
au FocusGained * :set rnu
<?php
class A
{
public $foo = "foo";
}
$a = new A();
list($a->foo, $b) = array("tolle", "wurst");
@michaelcontento
michaelcontento / fotoliasorter.py
Created November 17, 2012 13:07
fotolia categorizer
import re
import requests
from bs4 import BeautifulSoup
from path import path
def get_author(image_id):
html = requests.get("http://en.fotolia.com/id/" + str(image_id)).content
html_td = BeautifulSoup(html).find("td", class_="detail-grid-author")
return html_td.next_element.string
@michaelcontento
michaelcontento / ios_screen_orientation.patch
Created August 10, 2012 22:04
Monkey: IOS_SCREEN_ORIENTATION patch
diff --git src/trans/targets/ios.monkey src/trans/targets/ios.monkey
index e44b1c7..e434fbf 100755
--- src/trans/targets/ios.monkey
+++ src/trans/targets/ios.monkey
@@ -24,6 +24,26 @@ Class IosTarget Extends Target
Next
Return config.Join( "~n" )
End
+
+ Method ReplaceIosScreenOrientation()
@michaelcontento
michaelcontento / statusbar.patch
Last active October 8, 2015 10:27
Monkey: Hide the statusbar since the first second
diff --git targets/ios/MonkeyGame-Info.plist targets/ios/MonkeyGame-Info.plist
index e24e750..675f1e0 100755
--- targets/ios/MonkeyGame-Info.plist
+++ targets/ios/MonkeyGame-Info.plist
@@ -33,5 +33,9 @@
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
+ <key>UIStatusBarHidden</key>
+ <true/>
@michaelcontento
michaelcontento / armv6.patch
Created August 10, 2012 21:52
Monkey iOS armv6 patch
diff --git targets/ios/MonkeyGame.xcodeproj/project.pbxproj targets/ios/MonkeyGame.xcodeproj/project.pbxproj
index 0f6b73a..663d6e6 100755
--- targets/ios/MonkeyGame.xcodeproj/project.pbxproj
+++ targets/ios/MonkeyGame.xcodeproj/project.pbxproj
@@ -209,7 +209,10 @@
C01FCF4F08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)";
+ ARCHS = (
Strict
Import mojo.graphics
Import bono
Function Main:Int()
Local director:Director = New Director(640, 480)
Local text:Text = New Text("angel_verdana", New Vector2D(200, 100))
text.text = "Hello World"
@michaelcontento
michaelcontento / gist:3090110
Created July 11, 2012 12:37
CC Worker wrk96maqp55 NewRelic stack dump
[Wed Jul 11 12:31:13 2012] wrk96maqp55 ERROR (21922): newrelic.so, (signal 11), stack dump follow
/usr/lib/php5/20090626/newrelic.so(+0x2bbd5)[0x7fe70069cbd5]
/lib/libpthread.so.0(+0xf8f0)[0x7fe701fe28f0]
/usr/bin/php[0x6b7a83]
/usr/bin/php(_zval_dtor_func+0x3d)[0x696f6d]
/usr/bin/php(_zval_ptr_dtor+0x3d)[0x68afed]
/usr/lib/php5/20090626/mongo.so(zim_MongoDB_authenticate+0x185)[0x7fe701179bb5]
/usr/bin/php[0x6e876a]
/usr/bin/php(execute+0x210)[0x6bf870]
/usr/lib/php5/20090626/newrelic.so(+0x21bff)[0x7fe700692bff]
/secret-files.*
!/secret-files.sh
Aussetzer zwischen 01:00 Uhr und 02:00 Uhr
+---------------+----------+---------------------+---------------------+
| date(created) | count(*) | min(created) | max(created) |
+---------------+----------+---------------------+---------------------+
| 2012-06-26 | 102 | 2012-06-26 01:48:02 | 2012-06-26 01:54:36 |
| 2012-06-27 | 46 | 2012-06-27 01:50:09 | 2012-06-27 01:54:35 |
| 2012-06-28 | 109 | 2012-06-28 01:49:03 | 2012-06-28 01:56:33 |
| 2012-06-29 | 143 | 2012-06-29 01:48:18 | 2012-06-29 01:56:51 |
| 2012-06-30 | 29 | 2012-06-30 01:48:54 | 2012-06-30 01:51:04 |
| 2012-07-01 | 16 | 2012-07-01 01:49:59 | 2012-07-01 01:52:11 |