Skip to content

Instantly share code, notes, and snippets.

View 0x8801's full-sized avatar
😎
Probz working

ericg 0x8801

😎
Probz working
View GitHub Profile
@0x8801
0x8801 / export.js
Last active May 31, 2021 09:06
Export Wallet by BudgetBakers records to JSON
// Source for Jake Archibald's idb https://github.com/jakearchibald/idb/blob/v3.0.2/build/idb.js
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(global = global || self, factory(global.idb = {}));
}(this, function (exports) { 'use strict';
function toArray(arr) {
return Array.prototype.slice.call(arr);
}
// Highlight a phrase from an output in terminal
tail -f logfile.log | perl -pe 's/phrase/\e[1;41m$&\e[0m/g'
@0x8801
0x8801 / cat-clicker.markdown
Created September 26, 2017 12:56 — forked from anonymous/cat-clicker.markdown
Cat Clicker v1
FROM nginx:latest
RUN apt-get update && \
apt-get install -y sudo curl bzip2 wget git vim gnupg
RUN curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -
RUN sudo apt-get -y install build-essential
RUN sudo apt-get -y install nodejs

Mobile User Agent Strings

  • Opera Mini -> Opera/9.80 (Android; Opera Mini/8.0.1807/36.1609; U; en) Presto/2.12.423 Version/12.16
  • IE Mobile -> Mozilla/5.0 (compatible; MSIE 9.0; Windows Phone OS 7.5; Trident/5.0; IEMobile/9.0)
  • Android < V4.4 -> Mozilla/5.0 (Linux; U; Android 4.4.4; de-ch; HTC Sensation Build/IML74K) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30
  • iOS Safari -> Mozilla/5.0 (Linux; U; Android 4.4.4; de-ch; HTC Sensation Build/IML74K) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30
  • UC Browser -> Mozilla/5.0 (Linux; U; Android 4.4.4; en-US; XT1022 Build/KXC21.5-40) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 UCBrowser/10.7.0.636 U3/0.8.0 Mobile Safari/534.30
  • Blackberry Browser -> BlackBerry9700/5.0.0.351 Profile/MIDP-2.1 Configuration/CLDC-1.1 VendorID/123
  • Blackberry Browser 10 -> Mozilla/5.0 (BlackBerry; U; BlackBerry 9900; en) AppleWebKit/534.11+ (KHTML, like Gecko) Version/7.1.0.346 Mobile Safari/534.11+

Services vs. Factories vs. Providers

Technically speaking, their declarations differ in the following way

var app = angular.module('app', [])

// Service - Constructor function(s) is instantiated at service declaration therefore one shared instance of the function
app.service('myService', function() {
  this.myFunction = function() {
@0x8801
0x8801 / gist:eb75e7427de999768da8
Last active December 2, 2015 10:36
Koodishop SQL
CREATE TABLE koodishop_admin_name(
koodishop_admin_id integer primary key NOT NULL,
koodishop_admin_name text NOT NULL,
koodishop_admin_picture text NOT NULL,
created_at timestamp,
updated_at timestamp
);
CREATE TABLE shop(
shop_id integer primary key NOT NULL,
@0x8801
0x8801 / Drive.java
Created September 24, 2015 22:07
Drive.java Rewritten with an Abstract Class and Methods
public class Drive {
public abstract class GermanVehicles {
private String cost = "high";
protected String speedometer = "kilometers"
public int maxSpeed = 280;
public int currentSpeed;
}
public abstract class Safety extends GermanVehicles {
public void speedWarning(); //abstract
public void activateSpeedGovernor(int speed);
@0x8801
0x8801 / Drive.java
Last active September 24, 2015 20:42
public class Drive {
public class GermanVehicles {
String cost = "high";
String speedometer = "kilometers"
int maxSpeed = 280;
int currentSpeed;
}
interface Safety {
public void speedWarning();
public void activateSpeedGovernor(int speed);
@0x8801
0x8801 / childClass.java
Last active September 24, 2015 13:01
Inheritance & Polymorphism Simple Explanation
class parentClass {
public void parentMethod(){
// do general stuff
}
}
class childClass extends parentClass {
public void childMethod1() {
// do child-specific stuff
}