Skip to content

Instantly share code, notes, and snippets.

Avatar
🎧
‌‌

Wagner Souza waghcwb

🎧
‌‌
View GitHub Profile
@BaseCase
BaseCase / gist:2139106
Created Mar 20, 2012
A sample Cakefile
View gist:2139106
{exec} = require 'child_process'
task 'test', 'Runs all Jasmine specs in spec/ folder', ->
test()
task 'compile', 'Compiles coffee in src/ to js in bin/', ->
compile()
task 'stitch', 'Stitches all app .js files', ->
@monokrome
monokrome / interfaces.coffee
Last active Jan 9, 2018
Interfaces in CoffeeScript
View interfaces.coffee
class Host
constructor: ->
interfaces = @constructor.interfaces
if interfaces?
for interface in interfaces
_.extend @, interfaces
@implements: (host, interface) ->
# This effectively makes host optional
@simoncoulton
simoncoulton / gitkeep
Created Jan 8, 2014
Create empty gitkeep files in directories that are empty
View gitkeep
find . -type d -empty -exec touch {}/.gitkeep \;
View webpack.configuration.babel.js
import path from 'path';
import webpack from 'webpack';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import ExtractTextPlugin from 'extract-text-webpack-plugin';
import FriendlyErrorsWebpackPlugin from 'friendly-errors-webpack-plugin';
import PACKAGE from './package.json';
const banner = PACKAGE.name + ' - ' + PACKAGE.version + ' | ' +
'(c) 2016, ' + new Date().getFullYear() + ' ' + PACKAGE.author + ' | ' +
PACKAGE.license + ' | ' +
@tmpvar
tmpvar / managing-dependencies.md
Last active Oct 17, 2018
using modules in your new nodejs module
View managing-dependencies.md

Managing dependencies

Ok, so you've built your first module, but now you want to make it use one of the many libraries available via the npm registry.

finding modules

There are a few ways to find a module. You can use http://npmjs.org or http://npmsearch.com to find modules that may fit what you need.

some advice for choosing modules

@mattheath
mattheath / publicize-coderwall-membership.rb
Created Apr 12, 2013
Publicize membership of Coderwall organisations
View publicize-coderwall-membership.rb
require "github_api"
user = ''
token = ''
github = Github.new oauth_token: token
coderwall_orgs = []
github.orgs.list.each do |org|
coderwall_orgs << org.login if org.login =~ /^coderwall/
@GracjanZwr
GracjanZwr / node.md
Last active Jun 15, 2019
installing nodejs in Kali Linux
View node.md
@TakayoshiKochi
TakayoshiKochi / Custom-Elements-in-Imports.md
Last active Sep 3, 2019
CEv1 in classic HTML Imports
View Custom-Elements-in-Imports.md

Custom Elements V1 in HTML Imports

This document describes how custom elements v1 work when they are defined or used in HTML Imports.

HTML Imports is currently implemented only in Chrome, and this document provides non-normative information about Chrome's implementation in M54 and later, for the reference of future works that tries to achieve similar functionality like HTML Imports.

Defining Custom Element in an imported document

As the global context window is shared with script running in an imported document, you can access the custom elements registry via window.customElements. This is straightforward and no different from the usage in a usual HTML document.

View range-function.js
/**
* range()
*
* Returns an array of numbers between a start number and an end number incremented
* sequentially by a fixed number(step), beginning with either the start number or
* the end number depending on which is greater.
*
* @param {number} start (Required: The start number.)
* @param {number} end (Required: The end number. If end is less than start,
* then the range begins with end instead of start and decrements instead of increment.)
@camille-hdl
camille-hdl / es6-throttle.js
Last active Sep 3, 2020
Function throttling implementation in ES6
View es6-throttle.js
/*
http://www.es6fiddle.net/i8d8e1um/
*/
var throttle = (func,ms=50,context=window) => {
let to;
let wait=false;
return (...args) => {
let later = () => {
func.apply(context,args);
};