Skip to content

Instantly share code, notes, and snippets.

View bl4de's full-sized avatar
🇺🇦
#StandWithUkraine

Rafal Janicki bl4de

🇺🇦
#StandWithUkraine
View GitHub Profile
#!/usr/bin/env python
"""
A pure Python "ping" implementation, based on a rewrite by Johannes Meyer,
of a script originally by Matthew Dixon Cowles. Which in turn was derived
from "ping.c", distributed in Linux's netkit. The version this was forked
out of can be found here: https://gist.github.com/pklaus/856268
I've rewritten nearly everything for enhanced performance and readability,
and removed unnecessary functions (assynchroneous PingQuery and related).
@bl4de
bl4de / toolsupdater.sh
Created March 20, 2014 10:30
Security tools GitHub updater
#!/bin/bash
#
# security tools GitHub updater
#
# @bl4de | 20.03.2014
echo "Update sqlmap"
cd ~/hacking/tools/sqlmap
git pull origin master
echo "Update Golismero"
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"
@bl4de
bl4de / findInObjectArray() function
Created April 25, 2014 13:13
Function to find object in array of object by property value
function findInObjectArray(arr, search) {
var e = false;
arr.map( function(element) {
Object.getOwnPropertyNames(element).forEach( function(prop) {
if (element[prop] == search) {
e = element;
}
});
});
return e; // return false or Obj
@bl4de
bl4de / ParenthesesCheck.php
Created May 23, 2014 05:51
Simple parentheses checker function
<?php
$str2 = "(3 + 4) * 2"; // True
$str3 = ")3 * 23( + 4"; // False
$str4 = "if (a == b))"; // False
$str5 = "while (i < (b*12) + (j/34)"; // False
function check( $str ) {
$par = 0;
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Copyright (C) 2014 ADDY OSMANI <addyosmani.com>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
@bl4de
bl4de / gulpfile.js
Last active August 29, 2015 14:02
Sample Gulpfile.js - config for Gulp build (BB Platform)
/*global require,console*/
var gulp = require('gulp'),
less = require('gulp-less'),
livereload = require('gulp-livereload'),
watch = require('gulp-watch'),
jshint = require('gulp-jshint'),
concat = require('gulp-concat'),
uglify = require('gulp-uglify');
@bl4de
bl4de / dependency-sample.js
Last active August 29, 2015 14:02
Controller/Service dependency managemenet
// controller
App.controller('ListOfSomethingController', ['SomethingService', function(SomethingService) {
// whole list
var listOfSomething = SomethingService.getList().then(
function(response) {
$scope.list = response.data;
},
function(response) {
console.log('Uh oh, server made a boo boo :(');
@bl4de
bl4de / reset.css
Created July 6, 2014 07:07
HTML5 Ready CSS Reset
/*&nbsp;&nbsp;&nbsp;html5doctor.com Reset Stylesheet (Eric Meyer's Reset Reloaded + HTML5 baseline)&nbsp;&nbsp;v1.4 2009-07-27 | Authors: Eric Meyer & Richard Clark&nbsp;&nbsp;html5doctor.com/html-5-reset-stylesheet/*/
html, body, div, span, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
abbr, address, cite, code,
del, dfn, em, img, ins, kbd, q, samp,
small, strong, sub, sup, var,
b, i,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
@bl4de
bl4de / sampleapp.js
Created August 25, 2014 21:52
HTMLCollection + Array.prototype.forEach
// global click handler for navigation
var _hrefs = document.getElementsByTagName("a");
if (_hrefs && _hrefs.length > 0) {
Array.prototype.forEach.call(_hrefs, function (_href) {
_href.addEventListener("click", App.run, false);
});
}