Skip to content

Instantly share code, notes, and snippets.

@esironal
esironal / _readme.md
Created October 2, 2018 17:36 — forked from nolanlawson/_readme.md
Demo of a PouchDB reproducible test case
@esironal
esironal / ace-browser-editor.md
Last active September 27, 2018 13:03 — forked from teknogeek/ace-browser-editor.md
Ace Browser Editor

Change e.getSession().setMode(...) to "ace/mode/<language>" where <language> is your preferred programming language to have proper syntax highlighting. Then copy and paste the code into your browser bar and edit away :D.

data:text/html,
<div class="e" style="position: absolute; top: 0; right: 0; bottom: 0; left: 0;" id="editor"></div>
<script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script>
<script>
	var e = ace.edit("editor");
	e.setTheme("ace/theme/monokai");
	e.getSession().setMode("ace/mode/javascript");
@esironal
esironal / bash-colors.md
Created August 29, 2018 03:05 — forked from iamnewton/bash-colors.md
The entire table of ANSI color codes.

Regular Colors

Value Color
\e[0;30m Black
\e[0;31m Red
\e[0;32m Green
\e[0;33m Yellow
\e[0;34m Blue
\e[0;35m Purple
@esironal
esironal / app.js
Created August 3, 2018 11:51 — forked from thibauts/app.js
simple datastore
var fs = require('fs');
var localStore = require('./local-store');
var store = new localStore.Store({
path: '/var/data',
bucket: 'test'
});
var data = fs.readFileSync('/etc/passwd');
@esironal
esironal / extractLinks.js
Created August 3, 2018 11:50 — forked from thibauts/extractLinks.js
Extract links from a webpage with concat-stream
#http://www.dd-wrt.com/phpBB2/viewtopic.php?t=282831&start=435&sid=05c113416d737b2a58aa1a8708bb5e5b
#mount -o bind /mnt/sdb1 /jffs
#mount /dev/sda1 /jffs
mkdir -p /jffs/etc
mkdir -p /jffs/usr/local
mkdir -p /jffs/opt/bin/
mkdir -p /jffs/tmp/ipkg/
# Copy the contents of the current directories
@esironal
esironal / curl.md
Created December 7, 2017 12:16 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@esironal
esironal / Fix for android v4.2.2
Created May 29, 2017 21:33 — forked from stefanrusek/Fix for android v4.2.2
This is a work around for the appcompat v21 on android 4.2.2.
if (Build.VERSION.SDK_INT == Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1) {
menu = new MenuWrapper(menu) {
private MenuItem fix(MenuItem item) {
try {
Field f = item.getClass().getDeclaredField("mEmulateProviderVisibilityOverride");
f.setAccessible(true);
@esironal
esironal / loadScript.js
Created May 29, 2017 03:44 — forked from gustavopaes/loadScript.js
load a script, like a jsonp file, with callback and scope support
/**
* Carrega um script e executa callback
*/
(function(window, document, head) {
if(!window.loadScript) {
window.loadScript = function(url, callback, scope, charset) {
var sc = document.createElement('script');
sc.type = 'text/javascript';
sc.async = true;
sc.charset = charset || "utf-8";
@esironal
esironal / github-gist-api.js
Created May 28, 2017 23:11 — forked from techslides/github-gist-api.js
GitHub API to make Gists with Ajax
/*
Assuming jQuery Ajax instead of vanilla XHR
*/
//Get Github Authorization Token with proper scope, print to console
$.ajax({
url: 'https://api.github.com/authorizations',
type: 'POST',
beforeSend: function(xhr) {
xhr.setRequestHeader("Authorization", "Basic " + btoa("USERNAME:PASSWORD"));