Skip to content

Instantly share code, notes, and snippets.

@mrpotatoes
mrpotatoes / generics-help.md
Last active October 16, 2020 17:17
Complex generic + type explained

Understanding TS Generics better

I can't tell others how to write their libraries so that I can understand them easier. That's a given. That's also nonsense. I can do this with code at work though (which I do all the time). What I can do is learn how to read these things better. So I can decipher how others write their code.

But if you read the docs or take a bunch of courses you might not come away with a better understanding. I think it's just fine if your use cases are regular imperative code. When things are curried and you can write a signature for a function as a type within a type that's when things get more difficult.

And honestly, that's where I like to live. So it's time to do a little learning.

Problem statement

I was having issues with complex TypeScript generics/types. I wanted to figure out what was going on with the following function signature. I'm not used to generics espcially complicated ones. I'm fully aware that there are even more complicated ones but this isn't a dick measuring

@raysan5
raysan5 / custom_game_engines_small_study.md
Last active May 7, 2024 19:39
A small state-of-the-art study on custom engines

CUSTOM GAME ENGINES: A Small Study

a_plague_tale

A couple of weeks ago I played (and finished) A Plague Tale, a game by Asobo Studio. I was really captivated by the game, not only by the beautiful graphics but also by the story and the locations in the game. I decided to investigate a bit about the game tech and I was surprised to see it was developed with a custom engine by a relatively small studio. I know there are some companies using custom engines but it's very difficult to find a detailed market study with that kind of information curated and updated. So this article.

Nowadays lots of companies choose engines like Unreal or Unity for their games (or that's what lot of people think) because d

@sherl0cks
sherl0cks / tuned-adm.sh
Last active May 10, 2017 12:58
Simple way to set the power profile
# /bin/bash
profiles=($(tuned-adm list | awk 'NR > 1 {print $2}'))
echo -e "\n"
for ((i=0; i < ${#profiles}; i++))
do
echo $i -- ${profiles[$i]}
done
@Brainiarc7
Brainiarc7 / xclip-copy-to-clipboard.md
Created April 26, 2017 17:53
Using xclip to copy terminal content to the clip board on Linux

Using xclip to copy terminal content to the clip board:

Say you want to pipe shell output to your clipboard on Linux. How would you do it? First, choose the clipboard destination, either the Mouse clip or the system clipboard.

For the mouse clipboard, pipe straight to xclip:

echo 123 | xclip

For the system clip board, pipe to xclip and select clip directly:

@sintaxi
sintaxi / regions.txt
Last active March 28, 2022 02:12
Surge Regions
List of regions your project is served from when you deploy using surge.
yyz.surge.sh : 159.203.50.177 : CA : Toronto
jfk.surge.sh : 159.203.159.100 : US : New York
sfo.surge.sh : 138.197.235.123 : US : San Francisco
lhr.surge.sh : 46.101.67.123 : GB : London
ams.surge.sh : 188.166.132.94 : NL : Amsterdam
fra.surge.sh : 138.68.112.220 : DE : Frankfurt
sgp.surge.sh : 139.59.195.30 : SG : Singapore
<?php
// REF: http://stackoverflow.com/questions/14780804/how-do-i-read-a-google-drive-spreadsheet-in-php
$spreadsheet_url="https://docs.google.com/spreadsheets/d/1MLAko1Eym5O-Qt7cRQb55RBWH3ZHW2_VmHCV0x1Bx5s/pub?gid=0&single=true&output=csv";
$stack = array();
if(!ini_set('default_socket_timeout', 15)) echo "<!-- unable to change socket timeout -->";
@rxaviers
rxaviers / gist:7360908
Last active May 7, 2024 22:35
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@johnpolacek
johnpolacek / lazyloadimages.js
Last active December 17, 2015 14:59
Lazy Load Images
// <a href="product.html" data-lazy-image="product.jpg" data-lazy-image-alt="The Product"></a>
;(function($) {
$('*[data-lazy-image]').each(function() {
var alt = $(this).attr('data-lazy-image-alt') === undefined ? '' : 'alt="'+$(this).attr('data-lazy-image-alt')+'"';
$(this).append($('<img src="'+$(this).attr('data-lazy-image')+'" '+alt+'" />'));
});
}(jQuery));
@malarkey
malarkey / Contract Killer 3.md
Last active April 16, 2024 21:44
The latest version of my ‘killer contract’ for web designers and developers

When times get tough and people get nasty, you’ll need more than a killer smile. You’ll need a killer contract.

Used by 1000s of designers and developers Clarify what’s expected on both sides Helps build great relationships between you and your clients Plain and simple, no legal jargon Customisable to suit your business Used on countless web projects since 2008

…………………………

@getify
getify / gist:675496
Created November 13, 2010 17:18
detecting if flash plugin is installed
var _flash_installed = ((typeof navigator.plugins != "undefined" && typeof navigator.plugins["Shockwave Flash"] == "object") || (window.ActiveXObject && (new ActiveXObject("ShockwaveFlash.ShockwaveFlash")) != false));