Skip to content

Instantly share code, notes, and snippets.

View hsribei's full-sized avatar

Helder S Ribeiro hsribei

View GitHub Profile
@derhuerst
derhuerst / offline.md
Last active October 3, 2018 20:30
working offline as JavaScript dev

working offline as JavaScript dev

use npm@5

npm installs large dependency trees a lot faster. this is especially noticable over slow networks.

Running npm while offline will no longer insist on retrying network requests. npm will now immediately fall back to cache if possible, or fail. (npm/npm#15666)

use node_modules/*/readme.md

@bartaz
bartaz / gist:1119041
Created August 1, 2011 21:22
Convert JavaScript number to string of 64bit double precision floating point representation (IEEE 754)
// Convert a JavaScript number to IEEE-754 Double Precision
// value represented as an array of 8 bytes (octets)
//
// http://cautionsingularityahead.blogspot.com/2010/04/javascript-and-ieee754-redux.html
function toIEEE754(v, ebits, fbits) {
var bias = (1 << (ebits - 1)) - 1;
// Compute sign, exponent, fraction
@fpoirier1
fpoirier1 / email-template.html
Created June 11, 2014 18:01
Render template on server with UnderscoreJS
<!-- private/email-template.html -->
<div>Welcome {{name}}</div>
#!/usr/bin/ruby
`cat ~/.bash_aliases | egrep '^alias' | sed 's/alias//'`.split("\n").each do |line|
parts = line.strip.split(/=/)
name, cmd = parts[0], parts[1].gsub(/('|")/,'')
file = '/home/%s/.config/fish/functions/%s.fish' % [`whoami`.strip, name]
content = [ 'function %s' % name, ' %s $argv;' % cmd, 'end' ].join("\n")
File.open(file, 'w+'){|io| io.write(content) }
end
port module Spelling exposing (..)
import Html exposing (..)
import Html.App as App
import Html.Attributes exposing (..)
import Html.Events exposing (..)
import String
main =
@fasterthanlime
fasterthanlime / state-of-emergency-in-france.md
Last active March 26, 2021 21:29
What the state of emergency means in France, where it's been declared following the Paris attacks

Lightning Talk proposal for ReactiveConf 2017 http://www.reactiveconf.com #ReactiveConf

Porting Prezi to Elm in 99 lines of code

Elm is a statically-typed functional programming language. Its compiler produces safe JavaScript which is guaranteed to be free of runtime exceptions. Moreover Elm is packed with a bunch of powerful abstractions which let us build visual and reactive Web applications in a few lines of code.

As an example, I show the implementation of a simple framework for building Prezi-like presentations. It's just 99 lines of code!

@KyleAMathews
KyleAMathews / lambda.md
Last active May 13, 2022 00:49
Using Kafka and a Samza-like node.js architecture

Disclaimer

I'm still very new to Kafka, eventsourcing, stream processing, etc. I'm in the middle of building my first production system with this stuff and am writing this at the request of a few folks on Twitter. So if you do have experience, please do me and anyone else reading this a favor by pointing out things I get wrong :)

Inspirations

@ivar
ivar / spacemacs global search and replace.md
Last active August 1, 2022 00:04
spacemacs - global search and replace

There's a couple of ways, one way is

  • Get search results
    • Do SPC / and type in your search string
    • or SPC x S and search string - where x is your scope indicator (p for project, d for directory, etc..)
  • Once you have the occurences you want, hit C-c C-e inside the helm buffer to put all your match occurences and puts them into a special buffer called the edit buffer or something like that
  • in that buffer you can use any commands you'd normally use on a buffer
  • the C-c C-c to commit your changes.
# Thanks to this post:
# http://blog.ikato.com/post/15675823000/how-to-install-consolas-font-on-mac-os-x
$ brew install cabextract
$ cd ~/Downloads
$ mkdir consolas
$ cd consolas
$ curl -O http://download.microsoft.com/download/f/5/a/f5a3df76-d856-4a61-a6bd-722f52a5be26/PowerPointViewer.exe
$ cabextract PowerPointViewer.exe
$ cabextract ppviewer.cab