Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View lopezjurip's full-sized avatar
🎯
Focusing

Patricio López Juri lopezjurip

🎯
Focusing
View GitHub Profile
anonymous
anonymous / gist:3bc472ad0f9631025dce
Created March 26, 2015 03:14
bajador de carpetas siding
import cookielib
import os
import urllib
import urllib2
from bs4 import BeautifulSoup
import re
# Datos de la cuenta de siding
username = "<username>"
anonymous
anonymous / Cascading-Solar-System!.markdown
Created April 26, 2015 12:19
Cascading Solar System!

Cascading Solar System!

An Orrery in pure CSS3 (ok, Sass generated). Still WIP. Having great fun with it!

A Pen by Tady Walsh on CodePen.

License.

@Timber232
Timber232 / stickynote_font_fix.reg
Created April 21, 2015 14:12
Change font to consola (Windows Sticky Notes)
REGEDIT4
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts]
"Segoe Print (TrueType)"="consola.ttf"
"Segoe Print Bold (TrueType)"="consolab.ttf"
@phil-monroe
phil-monroe / 01-Faye Rails.md
Last active March 14, 2016 12:35
Embed scalable Faye into Rails app hosted with Puma, Thin, etc.

This is just a jotting of notes on how to embed Faye into a single Rails process. Makes it nice to do simple real time things without the need for a separate Faye server/process.

Also uses Faye Redis to work across load balanced Rails apps.

You also need to copy the compiled javascript into vendor/assets/javascripts and include into application.js manifest.

Ignore the numbers in the file names... just used to add order to the Gist.

This uses the faye/faye Github repo at edc5b42f6560d31eae61caf00f6765a90e1818d1 since I wanted to use with the Puma rack server and that is only available in the master branch (until Faye 1.0)

@gourneau
gourneau / ElasticSearch.sh
Last active December 12, 2017 21:06
Elastic Search 1.4.2 with Oracle Java 8
### Install Oracle Java 8, this means you agree to their binary license!!
cd ~
sudo add-apt-repository -y ppa:webupd8team/java
sudo apt-get update
echo debconf shared/accepted-oracle-license-v1-1 select true | sudo debconf-set-selections
echo debconf shared/accepted-oracle-license-v1-1 seen true | sudo debconf-set-selections
sudo aptitude -y install oracle-java8-installer
### Download and Install ElasticSearch
@hopsoft
hopsoft / readme2ghpage.rb
Created June 21, 2012 17:09
Convert your README.md on master to index.md on gh-pages
#!/usr/bin/env ruby
# checkout the readme from the master branch
`git checkout gh-pages; git checkout master README.md`
path = `pwd`.gsub(/\n/, "")
readme_path = File.join(path, "README.md")
index_path = File.join(path, "index.md")
# write the index readme file
@princejwesley
princejwesley / await-babel-repl.js
Last active January 9, 2021 09:20
REPL with standalone await + babel transform
const repl = require('repl');
const babel = require('babel-core');
function preprocess(input) {
const awaitMatcher = /^(?:\s*(?:(?:let|var|const)\s)?\s*([^=]+)=\s*|^\s*)(await\s[\s\S]*)/;
const asyncWrapper = (code, binder) => {
let assign = binder ? `global.${binder} = ` : '';
return `(function(){ async function _wrap() { return ${assign}${code} } return _wrap();})()`;
};
@nutanc
nutanc / GmailHelper.java
Created July 14, 2014 04:27
Helper class for Gmail API to send and receive mails
import com.google.api.client.auth.oauth2.Credential;
import com.google.api.client.auth.oauth2.TokenResponse;
import com.google.api.client.googleapis.auth.oauth2.GoogleAuthorizationCodeFlow;
import com.google.api.client.googleapis.auth.oauth2.GoogleAuthorizationCodeRequestUrl;
import com.google.api.client.googleapis.auth.oauth2.GoogleCredential;
import com.google.api.client.googleapis.auth.oauth2.GoogleTokenResponse;
import com.google.api.client.http.GenericUrl;
import com.google.api.client.http.HttpRequest;
import com.google.api.client.http.HttpRequestFactory;
import com.google.api.client.http.HttpTransport;
@Miserlou
Miserlou / shell_invoke.sh
Created August 31, 2017 20:00
Execute Lambda Shell Commands With Zappa
zappa invoke --raw 'import subprocess; print subprocess.check_output("ls");'

Minimum Viable Async with Node 6

With the release of Node 6.0.0, the surface of code that needs transpilation to use ES6 features has been reduced very dramatically.

This is what my current workflow looks like to set up a minimalistic and fast microservice using micro and async + await.

The promise