Skip to content

Instantly share code, notes, and snippets.

View pcbulai's full-sized avatar
👨‍💻
Coding

Paul Bulai pcbulai

👨‍💻
Coding
View GitHub Profile
@pcbulai
pcbulai / .bashrc
Last active November 11, 2021 09:44
.bashrc file with some useful aliases and functions
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# User specific aliases and functions
### autocorrects cd misspellings, 'cd /sur/src/linus' >> 'cd /usr/src/linux' ###
@pcbulai
pcbulai / sublime-text.sh
Created October 17, 2013 13:01
Sublime Text 3 installer on Fedora 19
## Install Sublime Text 3 on Fedora 19 ##
# Download Sublime Text 3 from http://www.sublimetext.com/3 . Make sure you download it as a tar.bz and that it has the right architecture
# Place this script in the same folder as your archive for ease of use, and cd there
# run this file with sudo chmod +x sublime-text.sh
#!/bin/sh
SCRIPT="#!/bin/sh
if [ \${1} == \"--help\" ]; then
/**
* The default JSHint output is somewhat wasteful, and very bland, making it hard for a human to
* parse. The following does IMO a better job and colours the output for you. This requires the
* `colors` package, available via npm. If you don't want the dependency, just remove the color
* commands from strings.
*
* Usage: When invoking jshint from the command line, point it to this file with the --reporter
* flag. e.g.
*
* jshint someFile.js --config /path/to/config.cfg --reporter /path/to/jshintReporter.js
@pcbulai
pcbulai / objSize.js
Created April 22, 2015 13:32
Get JS object size
function objectSize (obj) {
var key,
size = 0;
for (key in obj) {
if (obj.hasOwnProperty(key)) {
size++;
}
}
return size;
}
@pcbulai
pcbulai / csscomb.conf
Created May 19, 2015 09:24
csscomb.conf
{
// If plugin has trouble finding Node.js, replace this string with path
// to your `node` bin
"node-path" : ":/usr/local/bin",
// Full list of supported options and acceptable values can be found here:
// https://github.com/csscomb/csscomb.js/blob/master/doc/options.md
"config": {
// Whether to add a semicolon after the last value/mixin.
@pcbulai
pcbulai / config.json
Last active August 29, 2015 14:22 — forked from anonymous/config.json
{
"vars": {
"@gray-base": "#000",
"@gray-darker": "lighten(@gray-base, 13.5%)",
"@gray-dark": "lighten(@gray-base, 20%)",
"@gray": "lighten(@gray-base, 33.5%)",
"@gray-light": "lighten(@gray-base, 46.7%)",
"@gray-lighter": "lighten(@gray-base, 93.5%)",
"@brand-primary": "darken(#428bca, 6.5%)",
"@brand-success": "#5cb85c",
{
"bold_folder_labels": true,
"caret_extra_bottom": 0,
"caret_extra_top": 0,
"caret_extra_width": 1,
"caret_style": "phase",
"color_scheme": "Packages/Colorcoder/Seti_orig (Colorcoded).tmTheme",
"default_line_ending": "unix",
"draw_white_space": "all",
"ensure_newline_at_eof_on_save": true,
Stash this hunk [y,n,q,a,d,/,K,g,s,e,?]? :q
y - stash this hunk
n - do not stash this hunk
q - quit; do not stash this hunk or any of the remaining ones
a - stash this hunk and all later hunks in the file
d - do not stash this hunk or any of the later hunks in the file
g - select a hunk to go to
/ - search for a hunk matching the given regex
j - leave this hunk undecided, see next undecided hunk
J - leave this hunk undecided, see next hunk
@pcbulai
pcbulai / g:commit.sh
Created July 29, 2015 12:38
Stop fucking my CodeShip builds!
g:commit() {
message="${1}"
if [ $# -gt 1 ]; then
case "$1" in
-s)
message="${2} --skip-ci"
;;
esac
fi
git commit -m "${message}"
@pcbulai
pcbulai / hn_search.js
Last active October 1, 2015 16:30 — forked from kristopolous/hn_seach.js
hn job query search
function query() {
var
total = 0, shown = 0,
// HN is done with very unsemantic classes.
job_list = Array.prototype.slice.call(document.querySelectorAll('.c5a,.cae,.c00,.c9c,.cdd,.c73,.c88')),
query_list = Array.prototype.slice.call(arguments);
// This traverses up the dom stack trying to find a match of a specific class
function up_to(node, klass) {
if (node.className === klass) {