Skip to content

Instantly share code, notes, and snippets.

View nakiostudio's full-sized avatar
⚛️

Carlos Vidal nakiostudio

⚛️
View GitHub Profile
@nakiostudio
nakiostudio / express.js
Created February 22, 2019 11:31
Express
module.exports = (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require,ex;for(var o=0;o<r.length;o++)ex=s(r[o]);return ex})({1:[function(require,module,exports){
/*!
* accepts
* Copyright(c) 2014 Jonathan Ong
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*/
'use strict'
@nakiostudio
nakiostudio / regexCheatsheet.js
Created January 15, 2019 09:52 — forked from sarthology/regexCheatsheet.js
A regex cheatsheet 👩🏻‍💻 (by Catherine)
let regex;
/* matching a specific string */
regex = /hello/; // looks for the string between the forward slashes (case-sensitive)... matches "hello", "hello123", "123hello123", "123hello"; doesn't match for "hell0", "Hello"
regex = /hello/i; // looks for the string between the forward slashes (case-insensitive)... matches "hello", "HelLo", "123HelLO"
regex = /hello/g; // looks for multiple occurrences of string between the forward slashes...
/* wildcards */
regex = /h.llo/; // the "." matches any one character other than a new line character... matches "hello", "hallo" but not "h\nllo"
regex = /h.*llo/; // the "*" matches any character(s) zero or more times... matches "hello", "heeeeeello", "hllo", "hwarwareallo"
@nakiostudio
nakiostudio / gist:205a7c5920cc01530916e35efd929e67
Created June 27, 2018 22:20 — forked from pguillory/gist:729616
Hooking into Node.js stdout
var util = require('util')
function hook_stdout(callback) {
var old_write = process.stdout.write
process.stdout.write = (function(write) {
return function(string, encoding, fd) {
write.apply(process.stdout, arguments)
callback(string, encoding, fd)
}
(lldb) breakpoint set -S "-[TFSAuthConsumerCredential initWithOAuthConsumerKey:oAuthConsumerSecret:]"
(lldb) breakpoint set -n "-[Crashlytics crash]"
Breakpoint 1: where = T1Twitter`-[Crashlytics crash], address = 0x015ccf96
(lldb) breakpoint command add 1.1
Enter your debugger command(s). Type 'DONE' to end.
> thread return
> continue
> DONE
(lldb) platform select remote-ios
(lldb) process connect connect://localhost:6666
iPhone:~ root# debugserver *:6666 -waitfor Twitter
@nakiostudio
nakiostudio / CustomApplyOperator.swift
Created October 7, 2017 11:49
Extensions you can drag onto your project if you want to keep using a custom apply operator after EasyPeasy 1.6.0
import EasyPeasy
#if os(iOS) || os(tvOS)
import UIKit
infix operator <~
/**
Apply operator definitions
@nakiostudio
nakiostudio / injectReveal.sh
Created August 13, 2017 10:41
Using lldb to inject Reveal into a process
lldb attach -p `ps x|grep XING|grep -v grep|awk '{print $1}'`
expr (void*)dlopen("/Applications/Reveal.app/Contents/SharedSupport/iOS-Libraries/libReveal.dylib", 0x2);
expr [(NSNotificationCenter*)[NSNotificationCenter defaultCenter] postNotificationName:@"IBARevealRequestStart" object:nil];
c
// Never tried to run this code so expect compilation
// issues
func viewDidLoad() {
super.viewDidLoad()
// ScrollView
self.view.addSubview(self.scrollView)
self.scrollView <- Edges(0.0)
// CollectionView