Skip to content

Instantly share code, notes, and snippets.

View fetchTe's full-sized avatar

te fetchTe

View GitHub Profile
@fetchTe
fetchTe / gfonts.php
Created October 19, 2016 03:18 — forked from nikoskip/gfonts.php
Demo: http://nikoskip.me/gfonts.php | You only have to use the CSS import URL that Google gives you, for instance: http://fonts.googleapis.com/css?family=Cabin:500,700,500italic,700italic
<?php
$fontTypes = array('woff2', 'woff', 'ttf', 'svg', 'eot');
$gFontURL = 'http://fonts.googleapis.com/css?family=';
$uaFonts = array(
'woff2' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36',
'woff' => 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.0; Trident/4.0; GTB7.4; InfoPath.3; SV1; .NET CLR 3.1.76908; WOW64; en-US)',
'ttf' => 'Mozilla/5.0 (Linux; U; Android 2.2.1; en-ca; LG-P505R Build/FRG83) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1',
'svg' => 'Mozilla/5.0(iPad; U; CPU iPhone OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B314 Safari/531.21.10',
@fetchTe
fetchTe / package.json
Created September 26, 2016 03:28
Example / template for package.json
{
"name": "module-name",
"version": "0.0.1",
"description": "An example module to illustrate the usage of a package.json",
"author": "Your Name <you.name@example.org>",
"license": "MIT",
"contributors": [{
"name": "Foo Bar",
"email": "foo.bar@example.com"
}],

Keybase proof

I hereby claim:

  • I am artisin on github.
  • I am artisin (https://keybase.io/artisin) on keybase.
  • I have a public key whose fingerprint is F120 4AB0 1E07 4C0B 470C 631B 84EC DBCA 1509 0620

To claim this, I am signing this object:

<snippet>
<content><![CDATA[
<div class="codemirror-fixture" data-example="${1:name}"></div>]]></content>
<tabTrigger>-fx</tabTrigger>
<scope>text.html.markdown.multimarkdown, text.html.markdown</scope>
<description>data-example</description>
</snippet>
<snippet>
@fetchTe
fetchTe / lost.styl
Created June 21, 2016 18:12
Lost-Stylus-Mod
// Lost Grid v5.1.6 - https://github.com/corysimmons/lost
$gutter = 30px
$rtl = false
$flexbox = true
/**
* Sets a translucent background color to all elements it affects. Helpful while setting up, or debugging, the structure of your site to make sure all items are cleared correctly.
*
@fetchTe
fetchTe / kolme-closures.md
Created May 1, 2016 01:43
kolme response

Function: a bunch of code you can call. It can take any number of parameters, and it can have a name.

Closure: The context, or variables and their values around the function when it was defined.

Generator: a special function that can yield more than one result when called in a loop. Generator functions also have closures.

So to shortly answer to your question: functions can't do anything a generator cannot do; or, generators can do more. And they all have closures.

Here's a simple example to understand closures:

@fetchTe
fetchTe / sublime-keys.md
Created April 10, 2016 23:27
sublime-keys

Shortcut kets

  • Select obj scope ctrl + shift + j
@fetchTe
fetchTe / Ramda-Sanctuary-Learning.md
Last active April 9, 2016 19:11
Ramda and Sanctuary Learning
var safeHead = function(xs) {
  return S.ifElse(() => R.isNil(xs[0]), S.Nothing, S.Just, xs[0]);
};

const streetName = S.pipe([R.prop('addresses'), safeHead, R.map(R.prop('street'))]);

streetName({
  addresses: []
});

Js Functional Practice

Filter List

let filter_list = S.pipe([R.curry(S.is), R.filter]);

//num
let filter_number = filter_list(Number);
filter_number([1, 2, 'a', 'b']); // [1, 2]
filter_number([1, 'a', 'b', 0, 15]); // [1, 15]

Ramda Examples

Ramda Sometime Known As
all every
always const, constant
any some
head first, car
reduce foldl
reduceRight foldr