Skip to content

Instantly share code, notes, and snippets.

View muloka's full-sized avatar
💖
I may be slow to respond.

Muloka muloka

💖
I may be slow to respond.
View GitHub Profile
<cfscript>
function stripQuotes(str) {
var regex = '^"(.+)"$';
var pattern = createObject("java", "java.util.regex.Pattern");
var matcher = pattern.compile(regex).matcher(str);
return matcher.replaceAll("$1");
}
</cfscript>
@muloka
muloka / Preferences.sublime-settings.js
Last active December 11, 2015 10:48
Sublime Settings / Preferences
{
"caret_style": "phase",
"color_scheme": "Packages/Tomorrow Color Schemes/Tomorrow-Night.tmTheme",
"detect_indentation": false,
"detect_slow_plugins": false,
"folder_exclude_patterns":
[
".sass-cache",
".git",
".hg",
I have marked with a * those which I think are absolutely essential
Items for each section are sorted by oldest to newest. Come back soon for more!
BASH
* In bash, 'ctrl-r' searches your command history as you type
- Input from the commandline as if it were a file by replacing
'command < file.in' with 'command <<< "some input text"'
- '^' is a sed-like operator to replace chars from last command
'ls docs; ^docs^web^' is equal to 'ls web'. The second argument can be empty.
* '!!:n' selects the nth argument of the last command, and '!$' the last arg
# vagrant.yml
- hosts: all
user: vagrant
sudo: True
tasks:
- name: Update APT package cache
apt: update_cache=yes
- name: Upgrade APT packages
apt: upgrade=yes
## credit: http://fabian-affolter.ch/blog/the-lineinfile-module-of-ansible/
---
- hosts: alpine_install
user: root
tasks:
# - name: create a complete empty file
# command: /usr/bin/touch /test/test.conf
- name: create a new file with lineinfile
TASK: [npm install --production] **********************************************
failed: [10.0.0.10] => {"failed": true}
msg: this module requires key=value arguments (['production', 'state=present'])
FATAL: all hosts have already failed -- aborting

MOBILE WEB (at 25 minutes)

https://www.growthhacker.tv/jimmy-soni&4205a42e

Jimmy Soni (Managing Editor at the Huffington Post)
@jimmyasoni

  • You'll get a lot more traction as a publisher if you focus on mobile web than if you focus on mobile apps
  • The people that download your app our your hardcore loyalists
  • 80% to 85% of apps are never opened after their first open
def yield_placeholder(name, content = nil, &block)
if content_for?(name)
concat @view_flow.get(name)
else
if block_given?
content = capture(&block)
end
concat content
end
end
<!--
# ([].each {}).empty?
# .each returns the enumerator
# the block itself returns an array
-->
<% if @messages.each do |message| %>
<%# code or partial to display the message %>
<% end.empty? %>
You have no messages.
// NAD27 to NAD83/WSG84 converter
// http://transition.fcc.gov/mb/audio/bickel/DDDMMSS-decimal.html
// http://home.hiwaay.net/~taylorc/bookshelf/math-science/geodesy/datum/transform/molodensky/
// http://www.gov.bm/portal/server.pt?open=512&objID=330&&PageID=1460&mode=2&in_hi_userid=2&cached=true
var data = [
{ item: '1', lat: [32,19,45.5], lon: [-64,50,7.8] },
{ item: '2', lat: [32,19,1.6], lon: [-64,50,33.8] },
{ item: '3', lat: [32,18,49.2], lon: [-64,50,31.9] },
{ item: '4', lat: [32,18,10.3], lon: [-64,52,1.5] },