Skip to content

Instantly share code, notes, and snippets.

View vinzdef's full-sized avatar
🍋
][__( ͡~ ͜ʖ ͡°)__][

Vincent De Feo vinzdef

🍋
][__( ͡~ ͜ʖ ͡°)__][
View GitHub Profile
@vinzdef
vinzdef / running.sh
Created October 8, 2014 13:28
Check if process is running
#check if a process named X is running
if [ -z "$(pidof X )" ] #CHANGE X WITH PROCESS NAME
then
# process was found
else
# process not found
fi
#ALSO
@vinzdef
vinzdef / svg-to-body.js
Created October 17, 2014 07:18
load SVG into body - jQuery ajax request
$(el).ajax('image.svg', {}, 'html', function (data) { $("body").append(data) });
@vinzdef
vinzdef / makeRow.php
Last active August 29, 2015 14:10
make table row
function makeRow($td1, $td2) {
//Create Row
$ret = "<tr>";
//Loop trough functrion arguments
$index = 0;
//Stop when get_arg() evaluates to false
while (@$r = func_get_arg($index++)) {
//Add each argument as td
$ret .= "<td>$r</td>";
@vinzdef
vinzdef / bandit24-solution
Last active October 5, 2022 06:29
4 digit pin bruteforce using Bash expansions for Over The Wire bandit25
for x in {0..9}{0..9}{0..9}{0..9}; do
echo UoMYTrfrBFHyQXmg6gzctqAwOmw1IohZ $x | telnet localhost 30002 | egrep -v "Exiting|Wrong|I am";
echo "Try $x";
done
function $tag(tag, n){return document.getElementsByTagName(tag)[n]}
function $id(id){return document.getElementById(id)}
function $cl(cl, n){return document.getElementsByClassName(cl)[n]}
function hasClass(className, targetClass){
return (className).match(new RegExp(new RegExp('.*(\\b' + targetClass + '\\b).*')))
}
@vinzdef
vinzdef / gulpfile.js
Last active November 11, 2017 20:31
My ♥ gulpfile - SASS compile and source mapping , non-interrupting errors, GUI notifications, livereload, js concat
var fs = require('fs'),
gulp = require('gulp'),
sass = require('gulp-sass'),
autoprefixer = require('gulp-autoprefixer'),
sassMaps = require('gulp-sourcemaps'),
concat = require('gulp-concat'),
uglify = require('gulp-uglify'),
function fact (num){
this.cache = {}
//IF KEY NOT SET
if (!this.cache.hasOwnProperty(num)){
//COMPUTE AND MEMORIZE
fact.cache[num] = num <= 1 ? 1 : num * fact(num-1);
}
return fact.cache[num];
};
###/ CONFIG
HISTFILE=~/.histfile
HISTSIZE=1000
SAVEHIST=1000
# End of lines configured by zsh-newuser-install
# The following lines were added by compinstall
zstyle :compinstall filename '/home/ghzmdr/.zshrc'
@vinzdef
vinzdef / debounce.js
Created May 8, 2015 14:56
Debounce a function, simplified from _.js
function debounce (fn, wait){
var timeout;
return function(){
var context = this, args = arguments
var later = function() {
timeout = null
fn.apply(context, args)
}
clearTimeout(timeout)
timeout = setTimeout(later, wait)
{
"bold_folder_labels": true,
"color_scheme": "Packages/Oasis Theme/Oasis.tmTheme",
"file_exclude_patterns":
[
"*.sublime-*"
],
"font_face": "Envy Code R",
"font_size": 8,
"ignored_packages":