Skip to content

Instantly share code, notes, and snippets.

View pi0's full-sized avatar
👀

Pooya Parsa pi0

👀
View GitHub Profile
@pi0
pi0 / proposal.md
Last active August 4, 2017 09:34
git-pr

git-pr

(Based on a tweet by chrisvfritz)

A simple CLI tool for working with PR forks

  1. With git-pr, We can checkout with:
# Checkout in pr/123 branch
@pi0
pi0 / aliasthat.sh
Created June 13, 2017 09:49 — forked from znck/aliasthat.sh
Create an alias for last command.
function aliasthat {
if [ -n ${1} ]; then
fc -e "sed -i -e \"s/^.*/echo alias $1=\\\"'\\\"\'&\'\\\"'\\\" >> ~\/.bash_alias/\""
. ~/.bash_alias
fi
}
@pi0
pi0 / CKEditor.vue
Created June 2, 2017 15:12
CKEditor
<!-- Based on https://github.com/dangvanthanh/vue-ckeditor -->
<template>
<div class="ckeditor">
<textarea :id="id" :value="value"></textarea>
</div>
</template>
<style scoped>
.ckeditor {
@pi0
pi0 / count.js
Created May 16, 2017 07:31 — forked from yyx990803/count.js
// $ yarn add request request-promise
// $ node count userA userB
const request = require('request-promise')
const get = resource => request({
url: /^https/.test(resource) ? resource : `https://api.github.com/${resource}`,
headers: {
'User-Agent': 'GitHub Contrib Counter',
'Authorization': 'token YOUR_PERSONAL_ACCESS_TOKEN'
@pi0
pi0 / bootstrap.js
Created May 14, 2017 15:19
Bootstrap Vue Laravel Mix
window._ = require('lodash');
/**
* We'll load jQuery and the Bootstrap jQuery plugin which provides support
* for JavaScript based Bootstrap features such as modals and tabs. This
* code may be modified to fit the specific needs of your application.
*/
window.$ = window.jQuery = require('jquery');
@pi0
pi0 / docker-compose.yml
Created May 9, 2017 18:18
Docker Registry mirror
version: '3'
services:
mirror:
image: quay.io/banian/registry
volumes:
- /data/local/docker_mirror:/var/lib/registry
deploy:
placement:
constraints:
- node.hostname==node1
@pi0
pi0 / Bio.MD
Last active April 24, 2017 08:08
LinuxFest 2017
@pi0
pi0 / CEIT_PRINTER.md
Last active November 2, 2017 13:32
CEIT Printer with CUPS
  1. Install hplip and cups : sudo apt install hplip cups
  2. Open this URL: http://localhost:631
  3. administration > add printer > [select hp]
  4. smb://ceit\[username]:[password]@ceit/192.168.128.10/HPLaserJ4015
#include <errno.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
@pi0
pi0 / hosts.sh
Created January 25, 2017 14:11
raw.githubusercontent.com
echo "151.101.84.133 raw.githubusercontent.com" | sudo tee -a /etc/hosts