Skip to content

Instantly share code, notes, and snippets.

View neurodynamic's full-sized avatar
💭
GitHub still has a contract with ICE so I'm still not giving them any money.

neurodynamic neurodynamic

💭
GitHub still has a contract with ICE so I'm still not giving them any money.
View GitHub Profile
@yang-wei
yang-wei / decode.md
Last active April 2, 2024 20:18
Elm Json.Decode tutorial and cheatsheet

When receiving JSON data from other resources(server API etc), we need Json.Decode to convert the JSON values into Elm values. This gist let you quickly learn how to do that.

I like to follow working example code so this is how the boilerplate will look like:

import Graphics.Element exposing (Element, show)
import Task exposing (Task, andThen)
import Json.Decode exposing (Decoder, int, string, object3, (:=))

import Http
@NickWoodhams
NickWoodhams / close_deleted_file.py
Last active November 24, 2019 17:00
Close Deleted File - Sublime 3 Plugin
import sublime_plugin
import sublime
import time
import os
class MyEvents(sublime_plugin.EventListener):
def on_deactivated_async(self, view):
s = view.file_name()
if s:
@xslim
xslim / README.md
Created September 21, 2012 10:57
git commit hook for Harvest integration

Installation

  • Install hcl https://github.com/zenhob/hcl
  • cd MyProject
  • curl -L https://gist.github.com/raw/3760898/commit-msg.sh > .git/hooks/commit-msg
  • chmod +x .git/hooks/commit-msg
  • hcl tasks
  • Note ProjectID & TaskID
  • git config hooks.harvesttask "ProjectID TaskID"
  • Example: git config hooks.harvesttask "2551232 1441578"
@cnruby
cnruby / gist:893798
Created March 30, 2011 03:15
How To Use Rails The Function gsub_file
gsub_file 'config/environments/production.rb', /config.i18n.fallbacks = true/ do <<-'RUBY'
config.i18n.fallbacks = true
config.action_mailer.default_url_options = { :host => 'yourhost.com' }
RUBY
end
gsub_file 'config/environments/production.rb', /config.i18n.fallbacks = true/, "\
config.i18n.fallbacks = true
config.action_mailer.default_url_options = { :host => 'yourhost.com' }"