Skip to content

Instantly share code, notes, and snippets.

View amirulabu's full-sized avatar
🕸️
mirul.xyz

Amirul Abu amirulabu

🕸️
mirul.xyz
View GitHub Profile
@amirulabu
amirulabu / README.md
Created March 27, 2020 01:52
malaysia jajahan in json convert from php code https://github.com/lomotech/jajahan

how to convert from php array to json

use json_encode if php is not setup in your machine use this http://json_encode.onlinephpfunctions.com/ make sure the php version is recent or else you won't get your json

@mbarkhau
mbarkhau / do_nothing_script.py
Created July 22, 2019 19:54
do_nothing_script.py
#!/usr/bin/env python3
# Based on this https://news.ycombinator.com/item?id=20495739
# I created this boilerplate which I think is a bit nicer to use.
import sys
class AttrDict(dict):
@jimmywarting
jimmywarting / readme.md
Last active May 18, 2024 21:22
Cors proxies
Exposed headers
Service SSL status Response Type Allowed methods Allowed headers
@jonwolfe
jonwolfe / gist:7897610
Created December 10, 2013 20:22
This is how we use Google Analytics with Turbolinks. I put this in a analytics.js.coffee file and require it after turbolinks. That's it. Works on browsers that support Turbolinks and those that don't. Also works with parts of your app that may not use Turbolinks. If you need to record pageviews manually for any reason, just call GoogleAnalytics…
class @GoogleAnalytics
@load: ->
# Google Analytics depends on a global _gaq array. window is the global scope.
window._gaq = []
window._gaq.push ["_setAccount", GoogleAnalytics.analyticsId()]
# Create a script element and insert it in the DOM
ga = document.createElement("script")
ga.type = "text/javascript"
@JoshCheek
JoshCheek / Readme.md
Last active February 6, 2017 15:40
RSpec crash course.
  • specs go in the "spec" directory
  • specs end in "_spec.rb"
  • toplevel begins with describe
  • inside of a describe you have an it
  • example is an alias for it
  • inside of it blocks, you write your code and assertions
  • run with $ rspec or $ rspec spec/some_spec.rb
  • if you need common setup (e.g. add another dir to the load path), put into "spec/spec_helper.rb" and then `require "spec_helper" at the top of the spec
  • using let will allow you to name a value that you want to call from your spec,