Skip to content

Instantly share code, notes, and snippets.

View codeinvain's full-sized avatar

Daniel Cohen codeinvain

  • Cloudinary
  • Limassol, Cyprus
View GitHub Profile
-dontwarn com.pingjam.**
-keep class com.pingjam.**
-dontwarn com.google.**
-keep class com.google.**
-keepattributes Exceptions,InnerClasses,Signature,Deprecated,SourceFile,LineNumberTable,EnclosingMethod
@codeinvain
codeinvain / AndroidManifest.xml
Last active December 15, 2015 02:29
pingjam's android manifest permissions
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.PROCESS_OUTGOING_CALLS" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-feature android:name="android.hardware.telephony" android:required="false" />
@codeinvain
codeinvain / nginx
Created November 16, 2011 13:15
nginx upstart script
#! /bin/sh
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: nginx init.d script for Ubuntu 8.10 and lesser versions.
# Description: nginx init.d script for Ubuntu 8.10 and lesser versions.
### END INIT INFO
@codeinvain
codeinvain / bashrc
Created November 15, 2011 18:02
bash rc 4 ubuntu
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
if [[ -n "$PS1" ]]; then
# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace
@codeinvain
codeinvain / development.rb
Created August 26, 2011 07:42
override irb with pry
#config/environments/development.rb
MyApp::Application.configure do
silence_warnings do
begin
require 'pry'
IRB = Pry
rescue LoadError
end
end
@codeinvain
codeinvain / rails
Created August 26, 2011 07:07
rails/pry integration ("rails p" to run rails in pry console)
#!/usr/bin/env ruby
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
unless ARGV.empty? then
if ARGV[0] == 'pry' || ARGV[0] == 'p' then
system("pry -r #{File.expand_path('./config/environment')}")
exit
end
end
APP_PATH = File.expand_path('../../config/application', __FILE__)
@codeinvain
codeinvain / bash_PSI.sh
Created May 24, 2011 14:52
show branch or tag in bash
parse_git_branch () {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
parse_git_tag () {
git describe --tags 2> /dev/null
}
parse_git_branch_or_tag() {
@codeinvain
codeinvain / npm.xmllibjs.log
Created March 31, 2011 05:50
error log while installing libxmljs using npm
npm info it worked if it ends with ok
npm info using npm@0.3.18
npm info using node@v0.4.2
npm info preinstall libxmljs@0.4.1
make: scons: No such file or directory
make: *** [node] Error 1
npm info libxmljs@0.4.1 Failed to exec preinstall script
npm ERR! install failed Error: libxmljs@0.4.1 preinstall: `make node`
npm ERR! install failed `sh "-c" "make node"` failed with 2
npm ERR! install failed at ChildProcess.<anonymous> (/usr/local/lib/node/.npm/npm/0.3.18/package/lib/utils/exec.js:49:20)
@codeinvain
codeinvain / gist:711441
Created November 23, 2010 08:07
compile qt for vs2010
cd C:\Qt\4.7.1x32\
set PATH += C:\Qt\4.7.1x32\
set PATH += C:\Qt\4.7.1x32\bin
set LIB += C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Lib
set Include += C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include
private function onBodiesContact(e:b2ContactEvent):void
{
var b1:UIComponent = e.contact.GetFixtureA().GetBody().GetUserData();
var b2:UIComponent = e.contact.GetFixtureB().GetBody().GetUserData();
if (b1==p1 || b2 ==p1)
{
hitSound.play();
}
else if (b1==p2 || b2== p2)
{