Skip to content

Instantly share code, notes, and snippets.

View TheNoim's full-sized avatar
🏠
Working from home

Nils Bergmann TheNoim

🏠
Working from home
View GitHub Profile
var pako = require('pako');
var a = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
function btoa(b) {
var c, d, e = "";
for (c = 0,
d = b.length; d > c; c += 3) {
var f = 255 & b.charCodeAt(c)
, g = 255 & b.charCodeAt(c + 1)
, h = 255 & b.charCodeAt(c + 2)
, i = f >> 2
@TheNoim
TheNoim / DSBEncoding.js
Created February 14, 2017 19:56
Encode DSB mobile payload
/**
* Created by nilsbergmann on 14.02.17.
*/
const pako = require('pako');
const a = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
function btoa(b) {
let c, d, e = "";
for (c = 0,
d = b.length; d > c; c += 3) {
const f = 255 & b.charCodeAt(c)
@TheNoim
TheNoim / README.md
Created February 20, 2017 14:34
Filter vs async (RethinkDB)

What is faster ? Filter or do it by yourself ?

import ping table

install

run q.js

class Gcc < Formula
def arch
if Hardware::CPU.type == :intel
if MacOS.prefer_64_bit?
"x86_64"
else
"i686"
end
elsif Hardware::CPU.type == :ppc
if MacOS.prefer_64_bit?
fs.readFile(path, function (err, contents) {
if(err) callback(err, null);
r.db('db').table('images').insert({
user: name,
file: contents,
elo: 1000
}).run();
})
unset CPATH
unset C_INCLUDE_PATH
unset CPLUS_INCLUDE_PATH
unset OBJC_INCLUDE_PATH
unset LIBS
unset DYLD_FALLBACK_LIBRARY_PATH
unset DYLD_FALLBACK_FRAMEWORK_PATH
export SDKVER="11.o"
#export DEVROOT="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer"
@TheNoim
TheNoim / SecureStorage.js
Created July 22, 2017 11:09
Secure Storage Promise Wrapper
export default class SecureStorage {
/**
*
* @param {string} app
* @returns {SecureStorage}
*/
constructor(app) {
const self = this;
this.ready = new Promise((resolve, reject) => {
// RNCookieManagerIOS.h
#if __has_include(<React/RCTBridgeModule.h>)
#import <React/RCTBridgeModule.h>
#else
#import "RCTBridgeModule.h"
#endif
//#import <RCTBridgeModule.h>
@import WatchConnectivity;
@TheNoim
TheNoim / pushbullet.sh
Last active January 7, 2018 12:27 — forked from outadoc/pushbullet.sh
Pushbullet bash script
#!/bin/bash
if [ $# -eq 0 ]; then
echo "Usage: $0 <message> [title]"
exit
fi
MESSAGE=$1
TITLE=$2
@TheNoim
TheNoim / index.js
Created July 8, 2018 17:24
Express test for ios
const express = require('express')
const app = express()
app.get('/', (req, res) => res.send('Hello World!'))
app.listen(3000, () => console.log('Example app listening on port 3000!'))