Skip to content

Instantly share code, notes, and snippets.

🎩

HatScripts HatScripts

🎩
  • Australia
Block or report user

Report or block HatScripts

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@HatScripts
HatScripts / codepen_jokes.md
Last active Jul 3, 2019
Programming jokes/one-liners found on CodePen
View codepen_jokes.md
  • A Pen is worth a thousand docs.
  • Be the developer your linter thinks you are.
  • How do you comfort a JavaScript bug? You console it!
  • How would you React if I said I love Vue?
  • If you get tired, be like an AJAX request and REST.
  • If you want to flex your skills and go off the grid, try coding a layout with float.
  • Keep friends close and formatters closer.
  • Keep the <main> thing the <main> thing.
  • Knock knock! Race condition. Who's there?
  • Learning 3D transforms in CSS requires a little perspective.
@HatScripts
HatScripts / array.js
Last active Jul 17, 2019
JavaScript helper snippets
View array.js
// Find first value matching a condition
arr.find(e => someCondition(e))
// e.g.
[12, 5, 8, 130, 44].find(i => i > 100) // 130
[7, 3, 9, 5, 6, 1].find(i => i % 2 == 0) // 6
// Remove FIRST occurrence of value from array
let index = arr.indexOf(value)
if (index > -1) {
arr.splice(index, 1)
View webkit.css
*{
box-shadow: none !important;
transition: none !important;
-webkit-transition: none !important;
-moz-transition: none !important;
-o-transition: none !important;
}
@media /* Large screen, non-retina */
only screen and (min-width: 1000px) {
@HatScripts
HatScripts / video-thumbnails-generator.sh
Created Aug 24, 2018 — forked from shunchu/video-thumbnails-generator.sh
Batch generate thumbnails from mp4 files using ffmpg
View video-thumbnails-generator.sh
#!/bin/bash
# setup
FILES=name_of_file_to_match_*.mp4
SEEK_POINT=00:00:30
IMG_FORMAT=png
FRAME_SIZE=150X100
DEST=thumbnails
for f in $FILES
View play.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View examples.py_console.txt
Running: with_example
80% (8 of 10) |##################### | Elapsed Time: 0:00:00 ETA: 0:00:00
Running: with_example_stdout_redirection
100% (10 of 10) |#########################| Elapsed Time: 0:00:01 Time: 0:00:01
70% (7 of 10) |################## | Elapsed Time: 0:00:00 ETA: 0:00:00 80% (8 of 10) |##################### | Elapsed Time: 0:00:00 ETA: 0:00:00 90% (9 of 10) |######################## | Elapsed Time: 0:00:00 ETA: 0:00:00
100% (10 of 10) |#########################| Elapsed Time: 0:00:01 Time: 0:00:01
Running: basic_widget_example
100%|#########################################################################|
Test: N/A% |/ | ETA: --:--:-- 0.0 s/BTest: 100% || | Time: 0:00:00 1.9 MiB/s
1.7 MiB/s <<<|########################################|>>> 100% Time: 0:00:00
View AOL.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View xdiff_string_diff.js
function xdiff_string_diff(oldData, newData, contextLines) {
// discuss at: http://locutus.io/php/xdiff_string_diff
// original by: Brett Zamir (http://brett-zamir.me)
// based on: Imgen Tata (http://www.myipdf.com/)
// bugfixed by: Imgen Tata (http://www.myipdf.com/)
// improved by: Brett Zamir (http://brett-zamir.me)
// note 1: The minimal argument is not currently supported
// example 1: xdiff_string_diff('', 'Hello world!')
// returns 1: '@@ -0,0 +1,1 @@\n+Hello world!'
// (This code was done by Imgen Tata; I have only reformatted for use in Locutus)
You can’t perform that action at this time.