Skip to content

Instantly share code, notes, and snippets.

View codeinvain's full-sized avatar

Daniel Cohen codeinvain

  • Cloudinary
  • Limassol, Cyprus
View GitHub Profile
@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 / 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 / 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 / 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 / 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 / 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" />
-dontwarn com.pingjam.**
-keep class com.pingjam.**
-dontwarn com.google.**
-keep class com.google.**
-keepattributes Exceptions,InnerClasses,Signature,Deprecated,SourceFile,LineNumberTable,EnclosingMethod
using UnityEngine;
using System.Collections;
using Pingjam;
public class PingjamInit : MonoBehaviour
{
void Start ()
{
AdRock.Instance.Register (new OptInDialogOptions (){Theme=OptInDialogOptions.THEME_LIGHT,CustomButtonStyle=true});
}
@codeinvain
codeinvain / config.xml
Last active December 18, 2015 14:09
cordova config.xml configuration for pingam plugin (phonegap integration)
<?xml version="1.0" encoding="utf-8"?>
<cordova>
..
..
<plugins>
..
..
<plugin name="Pingjam" value="com.pingjam.phonegap.AdRockPlugin" />
</plugins>
</cordova>
@codeinvain
codeinvain / index.html
Created June 17, 2013 08:38
phonegap index.html (pingjam integration)
<!DOCTYPE html>
<html>
..
<body>
..
..
<script type="text/javascript" src="cordova-2.7.0.js"></script>
<script type="text/javascript" src="js/pingjam.js"></script>
<script type="text/javascript" src="js/index.js"></script>
..