Skip to content

Instantly share code, notes, and snippets.

Avatar

MDMCDC anovsiradj

View GitHub Profile
View master.blade.php
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{{ $pageTitle }}}</title>
<!-- Bootstrap -->
<link href="../assets/bootstrap/css/bootstrap.css" rel="stylesheet">
@Majkl578
Majkl578 / gist:2304479
Created Apr 4, 2012
Tiny php script to generate simple directory index.
View gist:2304479
#!/usr/local/bin/php
<?php
/**
* @author Michael Moravec
*/
$targetDir = $argc > 1 ? $argv[1] : getcwd();
if (!is_dir($targetDir)) throw new \InvalidArgumentException("Invalid dir '$targetDir'.");
@steveosoule
steveosoule / _.debounce.js
Created Oct 31, 2014
Javascript Standalone Underscore's Debounce
View _.debounce.js
// Returns a function, that, as long as it continues to be invoked, will not
// be triggered. The function will be called after it stops being called for
// N milliseconds. If `immediate` is passed, trigger the function on the
// leading edge, instead of the trailing.
var debounce = function(func, wait, immediate) {
var timeout;
return function() {
var context = this, args = arguments;
var later = function() {
timeout = null;
@RaduW
RaduW / DataTable Reload.md
Last active Jul 26, 2018
Testing dataTables reloading ( I need to completely change the structure, content and also columns).
View DataTable Reload.md

Datatables reloading

( changing the content and the column structure).

Unfortunately I couldn't find a way to do it in one go. There is the table.fnDestroy(true); but this removes the <table> element from the page as well. We could use this but then we need to wrap the table element in a div in order to have a place where to recreate the table.

anonymous
anonymous / overpass.geojson
Created Apr 26, 2017
data exported by overpass turbo
View overpass.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View States.csv
state region pop SATV SATM percent dollars pay
AL ESC 4041 470 514 8 3.648 27
AK PAC 550 438 476 42 7.887 43
AZ MTN 3665 445 497 25 4.231 30
AR WSC 2351 470 511 6 3.334 23
CA PAC 29760 419 484 45 4.826 39
CO MTN 3294 456 513 28 4.809 31
CT NE 3287 430 471 74 7.914 43
DE SA 666 433 470 58 6.016 35
DC SA 607 409 441 68 8.21 39
@ohryan
ohryan / responsive-align.less
Last active Apr 30, 2019
Bootstrap 3 Responsive Text Align
View responsive-align.less
.text-xs-left { text-align: left; }
.text-xs-right { text-align: right; }
.text-xs-center { text-align: center; }
.text-xs-justify { text-align: justify; }
@media (min-width: @screen-sm-min) {
.text-sm-left { text-align: left; }
.text-sm-right { text-align: right; }
.text-sm-center { text-align: center; }
.text-sm-justify { text-align: justify; }
@Integralist
Integralist / cancelAJAX.js
Created Nov 3, 2011
Try to cancel all jQuery AJAX requests currently running
View cancelAJAX.js
$.xhrPool = [];
$.xhrPool.abortAll = function() {
/* Original example used _underscore api
_.each(this, function(jqXHR) {
jqXHR.abort();
});
*/
$.each(this, function(jqXHR) {
jqXHR.abort();
@joshhartman
joshhartman / mcrypt-cbc.php
Last active Jul 10, 2019
Rijndael 256-bit Encryption Function (CBC)
View mcrypt-cbc.php
<?php
// Define a 32-byte (64 character) hexadecimal encryption key
// Note: The same encryption key used to encrypt the data must be used to decrypt the data
define('ENCRYPTION_KEY', 'd0a7e7997b6d5fcd55f4b5c32611b87cd923e88837b63bf2941ef819dc8ca282');
// Encrypt Function
function mc_encrypt($encrypt, $key){
$encrypt = serialize($encrypt);
$iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC), MCRYPT_DEV_URANDOM);
$key = pack('H*', $key);
@aaronpk
aaronpk / canonical.php
Created Dec 20, 2016
Given an input URL, find the canonical URL after following redirects and looking at rel=canonical
View canonical.php
<?php
if(!isset($_GET['url'])) {
?>
<form action="" method="get">
<input type="url" name="url">
<input type="submit" value="Go">
</form>
<?
die();
}