This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
tail -n 1000 /var/log/my.log | grep -oE "\b([0-9]{1,3}\.){3}[0-9]{1,3}\b" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat windows-EOL.txt | tr '\r' '\n' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require 'common.php'; | |
// base dateframes | |
$dateframe = new DateFrame('1960-01-01', '1974-04-01'); | |
$dateframes = $dateframe->asMonthIntervals(1); | |
$dateframes = array_reverse($dateframes); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$publicKey = "file://Users/dgiglio/.ssh/mykey.pem"; | |
$plaintext = "String to encrypt"; | |
openssl_public_encrypt($plaintext, $encrypted, $publicKey); | |
echo $encrypted; //encrypted string |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="application/javascript"> | |
// create web audio api context | |
var audioCtx = new (window.AudioContext || window.webkitAudioContext)(); | |
// create Oscillator and gain node | |
// connect oscillator to gain node to speakers |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# php linter of git tracked files | |
# passing --success argument will print no-error files in the list, | |
# otherwise, only files with parse errors will be displayed. | |
IFS=$'\n' #split filenames at newlines only | |
for file in `git ls-tree -r master --name-only` | |
do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
define("UPLOAD_DIR", "./"); | |
ini_set("upload_max_filesize", "200M"); | |
ini_set("post_max_size", "200M"); | |
if (!empty($_FILES["myFile"])) { | |
$myFile = $_FILES["myFile"]; | |
if ($myFile["error"] !== UPLOAD_ERR_OK) { | |
echo "<p>An error occurred.</p>"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
url: <b id="output"></b> | |
<script type="text/javascript"> | |
var curlToGet = function(curl){ | |
var url, data; | |
var getParams = function(e, i, arr){ | |
flag = this; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div> | |
<div ng-switch="controller.field_type"> | |
<!-- bool --> | |
<div ng-switch-when="bool"> | |
<button class="btn btn-default btn-block" | |
ng-class="controller.config_value ? 'btn-info' : 'btn-warning'" | |
ng-model="controller.config_value" | |
ng-click="updateBool()"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* https://medium.com/opinionated-angularjs/angular-model-objects-with-javascript-classes-2e6a067c73bc | |
*/ | |
.factory('Customer', function ($http, $log, KeyMap) { | |
var Customer = function(OtherCustomer){ | |
this.id = OtherCustomer.id; | |
this.keymap = KeyMap; | |
this.comparisons = []; | |
this.working = false; |