Skip to content

Instantly share code, notes, and snippets.

@mohammad-mghn
mohammad-mghn / emoji-array.txt
Last active December 5, 2023 09:32
emoji array
[
"😀",
"😃",
"😄",
"😁",
"😆",
"😅",
"😂",
"🤣",
"😊",
@Boorj
Boorj / Conf2.xml
Last active July 17, 2020 13:16
Jetbrains IDE (i.e. PhpStorm, WebStorm) config for highlighting Sphinx config files
<filetype binary="false" description="Sphinx.conf" name="Sphinx config file" icon="AllIcons.Nodes.Static">
<highlighting>
<options>
<option name="LINE_COMMENT" value="#" />
<option name="COMMENT_START" value="" />
<option name="COMMENT_END" value="" />
<option name="HEX_PREFIX" value="" />
<option name="NUM_POSTFIXES" value="" />
<option name="HAS_BRACES" value="true" />
</options>
@jlongster
jlongster / immutable-libraries.md
Last active November 7, 2024 13:11
List of immutable libraries

A lot of people mentioned other immutable JS libraries after reading my post. I thought it would be good to make a list of available ones.

There are two types of immutable libraries: simple helpers for copying JavaScript objects, and actual persistent data structure implementations. My post generally analyzed the tradeoffs between both kinds of libraries and everything applies to the below libraries in either category.

Libraries are sorted by github popularity.

Persistent Data Structures w/structural sharing

<?php
define('TP_URL', 'http://enzinna.tpondemand.com/');
define('TP_USER', 'admin');
define('TP_PASS', 'admin');
# GET a story
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, TP_URL."api/v1/UserStories/201?format=json");
@JonnyFunFun
JonnyFunFun / tp api example.php
Created November 25, 2013 15:14
Example on how to consume Targetprocess' REST API with PHP
<?php
define('TP_URL', 'http://enzinna.tpondemand.com/');
define('TP_USER', 'admin');
define('TP_PASS', 'admin');
# GET a story
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, TP_URL."api/v1/UserStories/201?format=json");
@pguillory
pguillory / gist:729616
Created December 5, 2010 23:51
Hooking into Node.js stdout
var util = require('util')
function hook_stdout(callback) {
var old_write = process.stdout.write
process.stdout.write = (function(write) {
return function(string, encoding, fd) {
write.apply(process.stdout, arguments)
callback(string, encoding, fd)
}
@remy
remy / gist:350433
Created March 31, 2010 14:58
Storage polyfill
if (typeof window.localStorage == 'undefined' || typeof window.sessionStorage == 'undefined') (function () {
var Storage = function (type) {
function createCookie(name, value, days) {
var date, expires;
if (days) {
date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
expires = "; expires="+date.toGMTString();