Skip to content

Instantly share code, notes, and snippets.


Pierre Lempérière Phazz

View GitHub Profile
View Telegram Bot for channel


Available Methods

Setup your bot to send messages to a channel

  1. Open, create a bot and get a <Bot_token>
  2. Go to your bot and launch it using /start
  3. Add your bot as an admin to the desired chat
  4. Send a test message to your bot from the channel use @bot_name
  5. Get updates received by your bot:<Bot_token>/getUpdates
  6. Get the chat_id from the response of step 4 result.$, it starts with a -
View tmux-cheatsheet.markdown

tmux shortcuts & cheatsheet

start new:


start new with session name:

tmux new -s myname
Phazz / 01-safe-download.rb
Created Apr 19, 2017 — forked from janko/01-safe-download.rb
A safe way in Ruby to download a file to disk using open-uri (with/without comments)
View 01-safe-download.rb
require "open-uri"
require "net/http"
Error =
View gist:44975695ad7f4882c1558a328c979a0e
heroku config:set SECRET_KEY=$(python -c 'import random; import string; print("".join([random.SystemRandom().choice("{}{}{}".format(string.ascii_letters, string.digits, string.punctuation)) for i in range(50)]))')
Phazz / install consolas on os x with one command
Last active Jul 16, 2016 — forked from piperswe/ install consolas on os x with one command
Install Consolas on OS X (based on avalonalex/8125197)
View install consolas on os x with one command
Thanks to this Gist:
How to use: Make sure Homebrew is installed then run `curl | bash -`
View gist:dba654f49f1f2fcbdb5bb49ae07f2293
### Keybase proof
I hereby claim:
* I am Phazz on github.
* I am pierrelemperiere ( on keybase.
* I have a public key whose fingerprint is E30C CE1D 447F AAB2 027C 95BB 903E BFB8 2EF6 C132
To claim this, I am signing this object:

I have the following task (removed some code for clarity) app/main/tasks/csv_exporter_tasks.rb

require 'mongo'

class CsvExporterTasks < Volt::Task
  include Mongo

  def run
    db = db_connect
View ruby_ftp_example.rb
require 'net/ftp'
CONTENT_SERVER_FTP_LOGIN = "saucy-ftp-server-login"
CONTENT_SERVER_FTP_PASSWORD = "saucy-ftp-server-password"
# LOGIN and LIST available files at default home directory, CONTENT_SERVER_FTP_LOGIN, CONTENT_SERVER_FTP_PASSWORD) do |ftp|
files = ftp.list

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url =

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

View tmux_cheatsheet.markdown

tmux cheatsheet

As configured in my dotfiles.

start new:


start new with session name:

You can’t perform that action at this time.