Skip to content

Instantly share code, notes, and snippets.

View arpit's full-sized avatar

Arpit Mathur arpit

View GitHub Profile
@arpit
arpit / gistio.md
Created July 18, 2012 23:24
GistIO test

Testing a Gist

I think it could be cool. For a number of reasons:

  • Like one
  • and 2
@arpit
arpit / gist:5165994
Created March 14, 2013 22:59
wtf mysql
Mar 13 15:20:29 ip-10-212-127-222 kernel: [1388067.480652] [ 3971] 106 3971 221943 14598 0 0 0 mysqld
Mar 13 15:20:29 ip-10-212-127-222 kernel: [1388067.480742] Out of memory: Kill process 3971 (mysqld) score 97 or sacrifice child
Mar 13 15:20:29 ip-10-212-127-222 kernel: [1388067.480973] Killed process 3971 (mysqld) total-vm:887772kB, anon-rss:58392kB, file-rss:0kB
Mar 13 15:20:29 ip-10-212-127-222 kernel: [1388067.620972] init: mysql main process (3971) killed by KILL signal
Mar 13 15:20:29 ip-10-212-127-222 kernel: [1388067.621019] init: mysql main process ended, respawning
Mar 13 15:20:29 ip-10-212-127-222 kernel: [1388068.095579] type=1400 audit(1363188029.689:15): apparmor="STATUS" operation="profile_replace" name="/usr/sbin/mysqld" pid=3728 comm="apparmor_parser"
Mar 13 15:20:30 ip-10-212-127-222 kernel: [1388068.658259] init: mysql main process (3732) terminated with status 1
Mar 13 15:20:30 ip-10-212-127-222 kernel: [1388068.658325] init: mysql main process ended, respawni
* Android added a method in the compatability lib called postOnAnimation that executes a Runnable in sync with display VSync. Does this help animation?
* You can add views during the layout pass by calling addViewInLayout
* Swapping a view's layer type (between hardware and software) may improve animation performance.
@arpit
arpit / arraydo.rb
Created July 14, 2016 00:50
Array basics
# arr.each_with_index do |value, index|
# arr[index] = value * 2
# end
(0..arr.length - 1).each do |v|
arr[v] = arr[v] * 2
end
#create empty hash
myhash = {}
# or
myh = Hash.new
# keys no value
info = { :name => nil, :address => nil }
#set value of keu
info[:name] = "arpit"
@arpit
arpit / user_oop.rb
Created July 24, 2016 23:51
Ruby OOP / Classes practice
class User
attr_accessor :first_name, :last_name
def self.set_species (s)
@@species = s
end
@arpit
arpit / q1.rb
Created November 15, 2016 22:01
Ruby quiz
class Man < Animal
def get_name
@name
end
end
Man.new = m
m.get_name
@arpit
arpit / layout_transition_stagger.java
Created July 13, 2012 22:27
Stagger LayoutTransitions in Android
package com.arpit.animatortest;
import android.animation.AnimatorSet;
import android.animation.LayoutTransition;
import android.animation.ObjectAnimator;
import android.app.Activity;
import android.graphics.Color;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;

Etherium talk:

3 languages used to write small contracts

Solidity : like js <- most developed compiles to the Etherium byte code that is run on Eth VM Another: Viper

Consys guys created a framework for Eth apps called Truffle