Skip to content

Instantly share code, notes, and snippets.

View NamPNQ's full-sized avatar
🤒
Out sick

Nam PHAM NamPNQ

🤒
Out sick
  • Ho Chi Minh
View GitHub Profile
@Alquimista
Alquimista / gist.py
Created August 28, 2012 15:27
jinja2 filters
def gist(id, filename=None):
if filename:
embedgist = (
'<script src="https://gist.github.com/%s.js?file=%s"></script>' % (
id, filename))
else:
embedgist = (
'<script src="https://gist.github.com/%s.js"></script>' % id)
return embedgist
@ba0f3
ba0f3 / init.el
Last active January 13, 2016 15:58
Emacs init file
(ido-mode 1)
(tool-bar-mode -1)
(scroll-bar-mode -1)
;(menu-bar-mode -1)
(show-paren-mode 1)
(eldoc-mode 1)
(defalias 'yes-or-no-p 'y-or-n-p)
(setq make-backup-files nil)
@panurge-ws
panurge-ws / gist:525caef640784a487aa2
Last active May 20, 2016 10:38
A Videgular plugin to emulate background-size CSS property for video (see comment below).
/*
* vg-bkg-size
* A Videogular plugin to emulate background-size CSS property for video: "cover" or "contain"
*
* Use:
* <videogular vg-bkg-size="cover" center="true"></videogular>
* vg-bkg-size => "cover" or "contain"
* center => true or false
*
* Copyright (c) 2014 Panurge Web Studio
@matthewp
matthewp / gist:3099268
Created July 12, 2012 16:50
XMLHttpRequest wrapped into a promise
function xhr(options) {
var deferred = Q.defer(),
req = new XMLHttpRequest();
req.open(options.method || 'GET', options.url, true);
// Set request headers if provided.
Object.keys(options.headers || {}).forEach(function (key) {
req.setRequestHeader(key, options.headers[key]);
});
@megastef
megastef / sematext-agent-docker.nomad
Last active May 21, 2017 14:28
Monitoring and Logging for all Docker containers on Nomad by HashiCorp
# Run Job Definition: nomad run sematext-agent-docker.nomad
# https://www.hashicorp.com/blog/nomad.html
# More Info: https://hub.docker.com/r/sematext/sematext-agent-docker/
# http://blog.sematext.com/2015/12/15/docker-logging-partner-sematext-logsene/
job "sematext-agent-docker" {
# set your region here
region = "global"
# Mandatory, parameter pls. change!
datacenters = ["us-west-1"]
# run this job globally
<!DOCTYPE html>
<html><head>
<title>Obfuscated name remapper</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
body {
background: white;
color: black;
font-family: "Trebuchet MS",Helvetica,Tahoma,Arial,sans-serif;
font-size: 90.01%;
@ViktorStiskala
ViktorStiskala / .gitconfig
Created August 13, 2013 13:27
Pycharm as a default git difftool and git mergetool. Add the following to ~/.gitconfig
[diff]
tool = pycharm
[difftool "pycharm"]
cmd = /usr/local/bin/pycharm diff "$LOCAL" "$REMOTE" && echo "Press enter to continue..." && read
[merge]
tool = pycharm
keepBackup = false
[mergetool "pycharm"]
cmd = /usr/local/bin/pycharm merge "$LOCAL" "$REMOTE" "$BASE" "$MERGED"
let participants = [
'JA',
'JB',
'Flo',
'Raph B',
'Raph H',
'Stephane',
'Laurent',
'Alex',
'Sevrain',
#!/usr/bin/env bash
curl https://s3.amazonaws.com/heroku-jvm-buildpack-vi/vim-7.3.tar.gz --output vim.tar.gz
mkdir vim && tar xzvf vim.tar.gz -C vim
export PATH=$PATH:/app/vim/bin
@NamPNQ
NamPNQ / README.MD
Last active July 31, 2020 06:05
RUST cross-compiling from Ubuntu to Windows using docker
  1. Go to your project
$ docker run -it --rm `pwd`:/opt/app rust bash
  1. Build
$ apt update &amp;&amp; apt install mingw-w64 -y