Skip to content

Instantly share code, notes, and snippets.

View heldr's full-sized avatar
🍵

Helder Santana heldr

🍵
View GitHub Profile
@heldr
heldr / addfont.cmd
Last active March 25, 2024 14:14
add windows fonts by command line
REM http://www.msfn.org/board/topic/119612-how-to-install-a-font-via-the-command-line/
@ECHO OFF
TITLE Adding Fonts..
REM Filename: ADD_Fonts.cmd
REM Script to ADD TrueType and OpenType Fonts for Windows
REM By Islam Adel
REM 2012-01-16
REM How to use:
@heldr
heldr / gulpfile.js
Last active August 26, 2020 12:24
Another way of splitting a gulpfile into multiple files
/*
Another way of splitting a gulpfile into multiple files based on:
http://macr.ae/article/splitting-gulpfile-multiple-files.html
https://github.com/gulpjs/gulp/blob/master/docs/recipes/split-tasks-across-multiple-files.md
*/
'use strict';
var gulp = require('gulp'),
plugins = require('gulp-load-plugins')(),

Keybase proof

I hereby claim:

  • I am heldr on github.
  • I am heldr (https://keybase.io/heldr) on keybase.
  • I have a public key ASBwmQHJaS4fN2i0fDYzEDHmCaCeTx6qbEgvx0ZTawpNMwo

To claim this, I am signing this object:

@heldr
heldr / App.tsx
Last active February 13, 2019 03:24
React hooks load page chunk (code splitting)
import React from 'react';
import { Router } from "@reach/router";
import LoadComponent from './LoadComponent';
const FoobarLoader = () => import('./pages/Foobar');
const App: React.StatelessComponent<{}> = () => (
<div>
<Router>
<LoadComponent componentAsPromised={FoobarLoader} path="foobar" />
@heldr
heldr / withToggle.js
Created September 20, 2016 15:43
Higher order component to toggle a prop value
/**
* Higher order component to toggle a prop value
*
* @see https://goo.gl/q7mQGm
* @function withToggle
* @returns Component
*/
export default function withToggle(WrappedComponent, propName = 'bool') {
class WithToggle extends Component {
constructor(props, context) {
@heldr
heldr / server.js
Created January 28, 2014 22:06
Simple node.js static server
var http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs"),
mimer = require('mimer'), // npm install mimer
spawn = require('child_process').spawn,
port = process.argv[2] || 9000;
http.createServer(function(request, response) {
@heldr
heldr / objextend.js
Created April 14, 2016 21:55
Assign, extend and merge
Object.assign({}, { a: 1, b: undefined })
Object {a: 1, b: undefined}
jQuery.extend({}, { a: 1, b: undefined })
Object {a: 1}
// lodash
_.extend({}, { a: 1, b: undefined })
Object {a: 1, b: undefined}

####How to create a bootable usb linux setup on mac (based on Trisquel tutorial )

$ hdiutil convert -format UDRW -o ~/path/to/linux.dmg ~/path/to/linux.iso

Insert your USB stick.

$ diskutil list

again to figure out the device file assigned to your USB stick (e.g. /dev/disk2).

@heldr
heldr / gist:6720204
Created September 26, 2013 20:40 — forked from snit-ram/gist:4557947
/*
* Copyright (c) 2011 Yahoo! Inc. All rights reserved.
*/
/*jslint nomen: true */
(function () {
'use strict';
function mix(target, source){
@heldr
heldr / 10things.md
Last active December 19, 2015 10:09
10 things to avoid if you attend a JS event
  • Freak douchebag guy with bob marley backpack
  • Lose control once you see a girl
  • Say coffee as possesive name