Skip to content

Instantly share code, notes, and snippets.

Alexandre Gaudencio Shahor

Block or report user

Report or block Shahor

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View proxy.js
let Process = require('process')
let obj = {
toto () {
return 42
}
}
function *range(s, e) {
for (; s < e; s++) {
yield s
View static.js
class Base {
constructor (id) {
this._id = id
}
say () {
console.log(this._id)
}
View win 10 hosts
# c.f. : https://twitter.com/EveningStarNM/status/627164963493130240
# Add these lines to HOSTS to block known Microsoft telemetry sites used by Windows 10 v2
127.0.0.1 compatexchange.cloudapp.net
127.0.0.1 a-0001.a-msedge.net
127.0.0.1 choice.microsoft.com
127.0.0.1 choice.microsoft.com.nsatc.net
127.0.0.1 corpext.msitadfs.glbdns2.microsoft.com
127.0.0.1 df.telemetry.microsoft.com
127.0.0.1 oca.telemetry.microsoft.com
@Shahor
Shahor / pr.js
Last active Aug 29, 2015
write a function that takes an array as input that can contain both ints and more arrays (which can also contain an array or int) and return the flattened array.
View pr.js
function flatten(input) {
var ret = []
input.forEach(function (inp) {
ret = ret.concat(Array.isArray(inp) ? flatten(inp) : inp)
})
return ret
}
@Shahor
Shahor / ebook2mobi.sh
Last active Aug 29, 2015
ebook converter
View ebook2mobi.sh
#!/usr/bin/env bash
if ! type "ebook-convert" > /dev/null; then
echo "ebook-convert tool not found in your PATH. Please install it (via Calibre) and re-run this script";
exit
fi
# Pass a path as first argument
function convert {
for file in "$1"/*
View keybase.md

Keybase proof

I hereby claim:

  • I am shahor on github.
  • I am shahor (https://keybase.io/shahor) on keybase.
  • I have a public key whose fingerprint is 09E3 944B 5F60 9B5C 015C 8800 2078 61F7 F265 2600

To claim this, I am signing this object:

@Shahor
Shahor / registrations_controller.rb
Created Dec 7, 2012 — forked from evanbeard/registrations_controller.rb
API JSON authentication with Devise
View registrations_controller.rb
class Api::RegistrationsController < Api::BaseController
respond_to :json
def create
user = User.new(params[:user])
if user.save
render :json=> user.as_json(:auth_token=>user.authentication_token, :email=>user.email), :status=>201
return
else
@Shahor
Shahor / tomorrowNight-theme.tmTheme
Created Jun 21, 2012
Tomorrow theme for sublimetext2
View tomorrowNight-theme.tmTheme
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>comment</key>
<string>http://chriskempson.com</string>
<key>name</key>
<string>Tomorrow Night</string>
<key>settings</key>
<array>
@Shahor
Shahor / trad.md
Created May 26, 2011
Modeste traduction
View trad.md

Préambule

Cet article est une traduction de ce blog post qui m'a beaucoup touché.

Je ne prétends pas être un traducteur expert Anglais/Français aussi il peut y avoir quelques approximations par endroits et je m'en excuse. Quoi qu'il en soit j'ai tout fait pour garder le sens initial de l'article et je pense avoir bien œuvré en ce sens.

Bonne lecture.

You can’t perform that action at this time.