Skip to content

Instantly share code, notes, and snippets.

View oozzal's full-sized avatar
🇳🇵
learning

Uzzal Devkota oozzal

🇳🇵
learning
View GitHub Profile
class MyException < Exception
end
class YourException < Exception
end
begin
raise MyException if 2 > 50
raise YourException if 1 < 90
rescue MyException
@oozzal
oozzal / iterate_file_system
Last active December 21, 2015 02:58
Ruby - working with files and directories.
child_folders = Dir[File.join(path, "*")].select{|file| File.ftype(file) == "directory"}.collect{|name| name.split("/").last}
child_files = Dir[File.join(path, "*")].select{|file| File.ftype(file) == "file"}.collect{|name| name.split("/").last}
@oozzal
oozzal / game.js
Created January 22, 2014 11:20
Quintus Ball Animation
var Q = Quintus().include("Sprites").setup({maximize: true});
// My extended module
Q.Sprite.extend("MySprite", {
orientation: {
horizontal: 'h',
vertical: 'v'
},
leftEdge: function() {
@oozzal
oozzal / pull_apk.md
Last active May 6, 2022 16:32
Pull Apk from device
  1. Determine the package name of the app, e.g. "com.example.someapp". Skip this step if you already know the package name.

adb shell pm list packages

Look through the list of package names and try to find a match between the app in question and the package name. This is usually easy, but note that the package name can be completely unrelated to the app name. If you can't recognize the app from the list of package names, try finding the app in Google Play using a browser. The URL for an app in Google Play contains the package name.

  1. Get the full path name of the APK file for the desired package.
<object width='425' height='344'>
<param name='movie' value='http://www.youtube.com/v/a0BOPX8yy4g&amp;fs=1' />
<param name='allowFullScreen' value='true' />
<param name='allowscriptaccess' value='always' />
<embed id='ytplayer' src='http://www.youtube.com/v/a0BOPX8yy4g&amp;fs=1' type='application/x-shockwave-flash' width='425' height='344' allowscriptaccess='always' allowfullscreen='true' />
</object>
<div class="STplayer STplayerEmbedded STplayerBarebones" id="STtranscriptEmbed_1_a0BOPX8yy4g" data-version="1.0">
<div class="STbar">
<div class="STlogo"><a href="http://speakertext.com/captionbox?ref=cb" target="_blank"></a></div>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
</head>
<body>
<div class="viewport"></div>
<script src="//cdnjs.cloudflare.com/ajax/libs/three.js/r58/three.min.js"></script>
<script src="//threejs.org/examples/js/controls/OrbitControls.js"></script>
@oozzal
oozzal / mNFRg1Tu1y8_transcript.html
Last active August 29, 2015 14:02
SpeakerText Captionbox Sample HTML
<object type="application/x-shockwave-flash" id="STautoID1" name="STautoID1" data="http://www.youtube.com/v/mNFRg1Tu1y8&amp;fs=1?&amp;enablejsapi=1&amp;playerapiid=STautoID1" width="425" height="344" class="STvideoPlayer" style="visibility: visible;">
<param name="allowFullScreen" value="true">
<param name="allowscriptaccess" value="always">
<param name="allowScriptAccess" value="always">
</object>
<div class="STplayer STplayerEmbedded STplayerBarebones" data-version="1.0" id="STtranscriptEmbed_1_mNFRg1Tu1y8">
<div class="STbar">
<div class="STlogo">
<a target="_blank" href="http://speakertext.com/captionbox?ref=cb"></a>
package main
import "io/ioutil"
func main() {
f, err := ioutil.ReadFile("go_file.txt")
if err != nil { panic(err) }
println(string(f))
}
package main
import (
"io/ioutil"
"os"
"strings"
)
func stringInSlice(a string, list []string) bool {
for _, b := range list {
@oozzal
oozzal / mini_server.py
Last active August 29, 2015 14:02
Simplest servers in Ruby and Python
python -m SimpleHTTPServer 5000