Skip to content

Instantly share code, notes, and snippets.

View Pk13055's full-sized avatar
🇦🇪
Focusing

Pk13055

🇦🇪
Focusing
View GitHub Profile
@Pk13055
Pk13055 / pastebin_formats.json
Created December 6, 2017 22:44
Formats supported by pastebin for syntax highlighting
{
"4cs ":" 4CS",
"6502acme ":" 6502 ACME Cross Assembler",
"6502kickass ":" 6502 Kick Assembler",
"6502tasm ":" 6502 TASM/64TASS",
"abap ":" ABAP",
"actionscript ":" ActionScript",
"actionscript3 ":" ActionScript 3",
"ada ":" Ada",
"aimms ":" AIMMS",
@Pk13055
Pk13055 / node_setup.sh
Created December 7, 2017 22:28
Shell script to install latest (Node v8.x) globally
#!/bin/bash
# Discussion, issues and change requests at:
# https://github.com/nodesource/distributions
#
# Script to install the NodeSource Node.js v8.x repo onto a
# Debian or Ubuntu system.
#
# Run as root or insert `sudo -E` before `bash`:
#
@Pk13055
Pk13055 / getPaths.php
Created December 10, 2017 06:37
Place these files at your file storage root to get a prettified frontend
<?php
/**
*
* @author Pratik Kamble
* This is responsible for making the JSON containing all the relevant paths
*
*/
function dirToArray($dir) {
$cur_level = array(
"path" => $dir . '/',
@Pk13055
Pk13055 / SCSS.md
Created December 12, 2017 17:42 — forked from jareware/SCSS.md
Advanced SCSS, or, 16 cool things you may not have known your stylesheets could do

⇐ back to the gist-blog at jrw.fi

Advanced SCSS

Or, 16 cool things you may not have known your stylesheets could do. I'd rather have kept it to a nice round number like 10, but they just kept coming. Sorry.

I've been using SCSS/SASS for most of my styling work since 2009, and I'm a huge fan of Compass (by the great @chriseppstein). It really helped many of us through the darkest cross-browser crap. Even though browsers are increasingly playing nice with CSS, another problem has become very topical: managing the complexity in stylesheets as our in-browser apps get larger and larger. SCSS is an indispensable tool for dealing with this.

This isn't an introduction to the language by a long shot; many things probably won't make sense unless you have some SCSS under your belt already. That said, if you're not yet comfy with the basics, check out the aweso

@Pk13055
Pk13055 / .aliases
Created December 12, 2017 19:12
Contains all useful aliases
# Add all user defined aliases here
alias volup='amixer -D pulse sset Master 10%+'
alias voldown='amixer -D pulse sset Master 10%-'
alias c='clear'
alias gcc='gcc -std=c99'
alias g++='g++ -std=c++14'
alias s='sudo service network-manager restart'
alias v='xclip -selection clipboard'
alias pip3='/usr/bin/pip3'
alias open='xdg-open'
@Pk13055
Pk13055 / gnome-tracker-disable.md
Created December 17, 2017 22:34 — forked from vancluever/gnome-tracker-disable.md
GNOME Tracker Disable

Disabling GNOME Tracker and Other Info

GNOME's tracker is a CPU and privacy hog. There's a pretty good case as to why it's neither useful nor necessary here: http://lduros.net/posts/tracker-sucks-thanks-tracker/

After discovering it chowing 2 cores, I decided to go about disabling it.

Directories

@Pk13055
Pk13055 / install_vim.sh
Created January 7, 2018 01:50
Installs the latest vim alongside `lua` and `python[2/3]` support
#!/bin/bash
sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-gui-common
sudo apt-get install liblua5.1-dev luajit libluajit-5.1 python-dev libperl-dev libncurses5-dev libatk1.0-dev libx11-dev libxpm-dev libxt-dev
#Optional: so vim can be uninstalled again via `dpkg -r vim`
# sudo apt-get install checkinstall
sudo rm -rf /usr/local/share/vim /usr/bin/vim
@Pk13055
Pk13055 / nginxproxy.md
Created January 20, 2018 22:38 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@Pk13055
Pk13055 / vpn.sh
Last active March 6, 2018 12:00
Script to switch on/off VPN/other connections
#!/bin/bash
if [ -z "$1" ]
then
status='up';
else
if [ "$1" == "list" ]
then
nmcli connection show && exit 0;
else
@Pk13055
Pk13055 / wpa_supplicant.conf
Created March 8, 2018 21:09
wpa supplicant configuration for raspberry pi WiFi connection
# interfaces(5) file used by ifup(8) and ifdown(8)
# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'
# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d
auto lo iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0 auto
wlan0 iface wlan0 inet dhcp
wpa-ssid "essid" # replace with e-ssid