Skip to content

Instantly share code, notes, and snippets.

View Shahor's full-sized avatar
🐢

Alexandre Gaudencio Shahor

🐢
View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<a href="https://slite.slite.com/api/s/note/TomjMvCc9tJLkEgJyW8BWD/Some-random-ipsum">PLOP</a>
let Process = require('process')
let obj = {
toto () {
return 42
}
}
function *range(s, e) {
for (; s < e; s++) {
yield s
class Base {
constructor (id) {
this._id = id
}
say () {
console.log(this._id)
}
# 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 August 29, 2015 14:08
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.
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 August 29, 2015 14:05
ebook converter
#!/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"/*

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 December 7, 2012 15:53 — forked from evanbeard/registrations_controller.rb
API JSON authentication with Devise
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 June 21, 2012 12:38
Tomorrow theme for sublimetext2
<?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 21:37
Modeste traduction

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.