Skip to content

Instantly share code, notes, and snippets.

View PanosJee's full-sized avatar

Panos Papadopoulos PanosJee

View GitHub Profile
@PanosJee
PanosJee / refinery_omniauth.rb
Created March 17, 2011 22:58
Login / Register to Refinery with Omniauth (facebook, twitter, openid, etc)
# Create a role user (no perms). Fire up the console rails c
$> Role.create(:title=>'User')
# In your Gemfile add
gem 'oa-oauth', :require => 'omniauth/oauth'
# At the beginning of devise.rb. You can also create a yaml file and instantiate when Rails begin
# For shake of simplicity I added the credentials at devise.rb
Facebook = Rails.env.development? ? {:app_id => 2621xxx, :secret => 'e81f33d042xxxxx'} :
{:app_id => 1749xxx9, :secret => '13c11be6628dc1xxxx'}
@PanosJee
PanosJee / B.json
Created October 20, 2018 21:27
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.25+commit.59dbf8f1.js&optimize=true&gist=
{
"VM:-": {
"linkReferences": {},
"autoDeployLib": true
},
"main:1": {
"linkReferences": {},
"autoDeployLib": true
},
"ropsten:3": {
Verifying my Blockstack ID is secured with the address 1JcqJ3ZfYXtA3cfDdmVTATfHPKC5DoyqiJ https://explorer.blockstack.org/address/1JcqJ3ZfYXtA3cfDdmVTATfHPKC5DoyqiJ
init([]) ->
% Start the scheduled GC job every minute. Naive!
erlang:send_after(60 * 1000, self(), {gc}),
{ok, no_state}.
handle_info({gc}, State) ->
case erlang:memory(binary) of
% We use more than 500 MB of binary space
Binary when Binary > 500000000 ->
erlang:garbage_collect(self())
function fetchdata()
local phandle = assert(io.open('event.json', 'r'))
local pdata = phandle:read('*all')
phandle:close()
return pdata
end
wrk.method = 'POST'
wrk.body = fetchdata()
wrk.headers['Content-Type'] = 'application/json'
init([]) ->
% Start the scheduled GC job every minute. Naive!
erlang:send_after(60 * 1000, self(), {gc}),
{ok, no_state}.
handle_info({gc}, State) ->
erlang:garbage_collect(self()),
erlang:send_after(60 * 1000, self(), {gc}),
{noreply, State}.
private async void GoTaskUnawaitedMethod(object sender, RoutedEventArgs e)
{
CrashUnawaitedTaskMethod();
}
private async Task CrashUnawaitedTaskMethod()
{
throw new Exception("Task Unawaited");
}
private async void CrashUnawaitedVoidMethod(object sender, RoutedEventArgs e)
{
throw new Exception("Void Unawaited");
}
@PanosJee
PanosJee / gist:6580198
Last active December 23, 2015 04:29 — forked from anonymous/gist:5592740
-optimizationpasses 25
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
-printmapping out.map
-renamesourcefileattribute SourceFile
-keepattributes SourceFile,LineNumberTable
-keep class com.bugsense.** { *; }
@PanosJee
PanosJee / gist:6157043
Last active December 20, 2015 15:49
BugSense Helpshift iOS Integration example
// in didFinishLaunchingWithOptions at AppDelegate.m
[BugSenseController setErrorNetworkOperationsCompletionBlock:^() {
NSLog(@"Application crashed with errorId: %ld with an error count since last reset: %d", [BugSenseController lastCrashId], [BugSenseController crashCount]);
if ([BugSenseController crashCount] == 1) { // after every crash, customize!
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"We're sorry!"
message:@"We are aware of the crashes that you have experienced lately. Would you like to tell us more about it?"
delegate:self
cancelButtonTitle:@"No"