Skip to content

Instantly share code, notes, and snippets.

View dbachet's full-sized avatar

Damien Bachet dbachet

View GitHub Profile
@chrmod
chrmod / setup-ember-cli.md
Last active August 29, 2015 14:06
ember-cli environment setup

Setting up ember-cli environment

This is a simple HOWTO for setting up and running simple ember-cli application. If any of step below does not work for you, please leave comment under this gist: https://gist.github.com/chrmod/702fe8391e9d17dbc151

1. nvm

Check if nvm is installed in use space:

look for ~/.nvm/nvmsh

@jerel
jerel / page.js
Last active November 27, 2019 23:24
Making the default Twitter tweet widgets work in an EmberJS application. This adds the twitter widget script after the tweets are in the DOM.
// Method 1
// add the twitter widget library to the bottom of app/index.html (after your Ember app)
<script src="//platform.twitter.com/widgets.js" charset="utf-8"></script>
// initialize it after the content is in the DOM
import Ember from 'ember';
export default Ember.View.extend({
didInsertElement: function() {
window.twttr.widgets.load();
@demental
demental / pre-push
Last active December 30, 2015 18:49
Pre push hook to avoid focused: true pushed in repo
#!/usr/bin/env ruby
# vim: set syntax=ruby
flag = false
Dir.glob("spec/**/*_spec.rb") do |file|
results = `cat #{file} | grep -E "(\:focused => true)|(focused\: true)"`.split("\n").map { |r| r.sub(/^\+[\s\t]*/, '') }
if $? == 0
puts file
class HashMemoize
def memoized_value key
@memo_hash ||= Hash.new { |hsh, new_key| hsh[new_key] = some_heavy_computation new_key }
@memo_hash[key]
end
private
def some_heavy_computation key
puts "heavy duty for #{key} !"
key * 2
@mudge
mudge / en.rb
Last active September 5, 2023 09:32
Using date ordinals in Rails through an I18n time format.
# This goes in config/locales/en.rb (*not* en.yml)
{
:en => {
:time => {
:formats => {
:full => lambda { |time, _| "%H:%M | %A, #{time.day.ordinalize} %B %Y" }
}
}
}
}
@endolith
endolith / Has weird right-to-left characters.txt
Last active June 1, 2024 10:58
Unicode kaomoji smileys emoticons emoji
ּ_בּ
בּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
תּ_תּ
٩(×̯×)۶
٩(̾●̮̮̃̾•̃̾)۶