This file contains 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 | |
$ace_light = [ | |
'chrome' => 'Chrome', | |
'clouds' => 'Clouds', | |
'crimson_editor' => 'Crimson Editor', | |
'dawn' => 'Dawn', | |
'dreamweaver' => 'Dreamweaver', | |
'eclipse' => 'Eclipse', | |
'github' => 'GitHub', | |
'iplastic' => 'IPlastic', |
This file contains 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
.ace_hidden-cursors { | |
opacity:0 | |
} |
This file contains 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
// As a function | |
function sleep(ms) { | |
return new Promise(resolve => setTimeout(resolve, ms)); | |
} | |
// One liner | |
await new Promise(r => setTimeout(r, 2000)); | |
// Or | |
const sleep = ms => new Promise(r => setTimeout(r, ms)); |
This file contains 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
def is_odd(num): | |
if k == 1: | |
return True | |
elif k == 0: | |
return False | |
elif (num < 0): | |
return is_odd(num * -1) | |
else: | |
return is_odd(num - 2) |
This file contains 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 | |
function computePermutations($array) { | |
$result = []; | |
$recurse = function($array, $start_i = 0) use (&$result, &$recurse) { | |
if ($start_i === count($array)-1) { | |
array_push($result, $array); | |
} | |
for ($i = $start_i; $i < count($array); $i++) { |
This file contains 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
var PinIt = require('pin-it-node'); | |
var pinIt = new PinIt({ | |
username: 'your_pinterest_username', | |
password: 'your_pinterest_password' | |
}); | |
var settings = { | |
boardId: 'Numeric_board_id', | |
url: process.argv[2], |
This file contains 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
(function ($) { | |
$.fn.showIf = function (check) { | |
if (check) { | |
$(this).show(); | |
} | |
else { | |
$(this).hide(); | |
} | |
}; |
This file contains 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
function isBase64(str) { | |
try { | |
return btoa(atob(str)) == str; | |
} catch (err) { | |
return false; | |
} | |
} |
This file contains 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
import unittest | |
class TestClass(unittest.TestCase): | |
def test(self): | |
exp = 4 | |
actual = 4 | |
self.assertEqual(exp, actual, 'Some Message') |
This file contains 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 | |
/** | |
* Plugin Name: Disable Scaled Images | |
* Plugin URI: https://www.nutt.net | |
* Description: One liner to turn off automatic scaled image creation for large images | |
* Version: 0.1.0 | |
* Requires at least: 5.2 | |
* Requires PHP: 7.2 | |
* Author: Ryan Nutt | |
* Author URI: https://www.nutt.net |
NewerOlder