Skip to content

Instantly share code, notes, and snippets.

const doubler = (input) => {
return doubler.operationsByType[typeof input](input);
};
doubler.operationsByType = {
number: (input) => input + input,
string: (input) =>
input
.split('')
.map((letter) => letter + letter)
.join(''),
@WebFreak001
WebFreak001 / d_to_html.d
Last active October 9, 2017 22:17
Create websites using D, with a cool syntax
module d_to_html;
import std.conv;
import std.stdio;
import std.traits;
import std.range;
struct Element
{
string _name;
#!/usr/bin/env python2
# Author: Chris Dellin <[email protected]>
# Date: 2016-09-14
# Script to scrape a working OAuth code from Google
# using the approach from dequis and hastebrot
# for use with hangups, purple-hangouts, etc.
# Requires packages python-gi and gir1.2-webkit-3.0 on Ubuntu 16.04.
/* -------------------------------------------------------------------------- */
import Dll_ = core.sys.windows.dll;
import W32_ = core.sys.windows.windows;
/* -------------------------------------------------------------------------- */
/* --- runtime initialisation --- */
version (CRuntime_DigitalMars) {} else {static assert(0);};
@Cauterite
Cauterite / gcstub.d
Created September 1, 2016 16:09
dmd-frontend GC
/**
* This module contains a minimal garbage collector implementation according to
* published requirements. This library is mostly intended to serve as an
* example, but it is usable in applications which do not rely on a garbage
* collector to clean up memory (ie. when dynamic array resizing is not used,
* and all memory allocated with 'new' is freed deterministically with
* 'delete').
*
* Please note that block attribute data must be tracked, or at a minimum, the
* FINALIZE bit must be tracked for any allocated memory block because calling
@UplinkCoder
UplinkCoder / ctfeTest.d
Last active November 1, 2018 16:46
Current Compilable code with the new CTFE engine
struct V3 {
int x;
int y;
int z;
int w = 30;
}
int fn(V3 v3) {
return v3.y;
}
int fn2(V3 v3) {
anonymous
anonymous / funcs.js
Created January 6, 2016 15:49
7 js function
debounce = function debounce(func, wait, immediate) {
var timeout;
return function() {
var context = this, args = arguments;
var later = function() {
timeout = null;
if (!immediate) func.apply(context, args);
};
var callNow = immediate && !timeout;
clearTimeout(timeout);
https://github.com/darylrowland/react-native-remote-push
https://facebook.github.io/react-native/docs/pushnotificationios.html
Pubnub can also do realtime chat, but it's a relatively expensive service.
The node.js server can be augmented with socket.io and function as a real-time chat server.
Amazon SNS https://aws.amazon.com/sns/
https://aws.amazon.com/sns/pricing/ (faily cheap and works for all platforms, plus we'd get tech support at the loft)
@rkirsling
rkirsling / LICENSE
Last active October 23, 2019 11:01
Trend Chart (Area + Line)
Copyright (c) 2014 Ross Kirsling
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions: