Skip to content

Instantly share code, notes, and snippets.

View stivenson's full-sized avatar
🏠
Working from home

Stivenson stivenson

🏠
Working from home
View GitHub Profile
@endolith
endolith / Has weird right-to-left characters.txt
Last active July 17, 2024 12:41
Unicode kaomoji smileys emoticons emoji
ּ_בּ
בּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
תּ_תּ
٩(×̯×)۶
٩(̾●̮̮̃̾•̃̾)۶
@ecentinela
ecentinela / Change author details in commit history
Created October 2, 2009 11:17
Change author / commiter details in all commits (WARNING: Will change all SHA1s)
#!/bin/sh
git filter-branch --env-filter '
an="$GIT_AUTHOR_NAME"
am="$GIT_AUTHOR_EMAIL"
cn="$GIT_COMMITTER_NAME"
cm="$GIT_COMMITTER_EMAIL"
if [ "$GIT_COMMITTER_EMAIL" = "your@email.to.match" ]
@jonkemp
jonkemp / prepopulate.html
Created April 5, 2011 15:11
Pre-populate your forms with random data. For testing forms. Requires jQuery. Includes a bookmarklet.
<!-- include jQuery -->
<script>
$('form').find('input:text').val( function(i, val) {
return $(this).attr('name');
});
$('form').find('select').each( function(a) {
$(this).find('option').each( function(b) {
if ( $(this).val() !== '' ) {
$(this).parent().val( $(this).val() );
@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@barryvdh
barryvdh / _ide_helper.php
Last active May 6, 2024 07:45
Laravel IDE Helper for Netbeans / PhpStorm / Sublime Text 2 CodeIntel, generated using https://github.com/barryvdh/laravel-ide-helper
<?php
/**
* A helper file for Laravel 5, to provide autocomplete information to your IDE
* Generated for Laravel 5.5.13 on 2017-09-28.
*
* @author Barry vd. Heuvel <barryvdh@gmail.com>
* @see https://github.com/barryvdh/laravel-ide-helper
*/
namespace {
exit("This file should not be included, only analyzed by your IDE");
@agendor
agendor / hapijs-rest-api-tutorial.md
Last active August 31, 2021 08:31
A practical introduction to building a RESTful API with the hapi.js server framework for Node.js
@mitchwongho
mitchwongho / Docker
Last active June 26, 2024 07:28
Docker 'run' command to start an interactive BaSH session
# Assuming an Ubuntu Docker image
$ docker run -it <image> /bin/bash
@guerrerocarlos
guerrerocarlos / duckCount.js
Created May 28, 2014 23:20
functional-javascript duckCount solution
function duckCount(){
function Count(args,pos,count){
if(pos<args.length) return Count(args,pos+1,count + Object.prototype.hasOwnProperty.call(args[pos], "quack") ? 1 : 0)
else return count
}
return Count(arguments,0,0);
}
module.exports = duckCount
function lbPick (a){
var str = '';
a.forEach(function(field){
str+='&filter[fields]['+field+']=1';
});
return str;
}
function lbGetPage(page){
var str = '&filter[limit]=50&filter[skip]=' + ((page-1) * 50);
@danharper
danharper / 1-sleep-es7.js
Created February 8, 2015 16:55
ES7's async/await syntax.
// ES7, async/await
function sleep(ms = 0) {
return new Promise(r => setTimeout(r, ms));
}
(async () => {
console.log('a');
await sleep(1000);
console.log('b');
})()