Function | Shortcut |
---|---|
Move back one character | Ctrl + b |
Move forward one character | Ctrl + f |
Delete current character | Ctrl + d |
Delete previous character | Backspace |
Undo | Ctrl + - |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The code below will extend underscore.js adding the groupByAndMap function. | |
// groupByAndMap works like the regular groupBy, but it accepts an optional third "selector" argument. | |
// The 'selector' is used to select values inside each group. | |
// As usual in underscore, you can either pass a function or a string with the name of an attribute you want. | |
// groupByAndMap is useful when you don't want the key to be present in the values inside the group. | |
// Also, it completely covers the groupBy functionality because the last argument is optional. | |
// If you want, you can replace groupBy instead of defining a new function. | |
_.mixin({ | |
groupByAndMap: function(list, keySelector, valueSelector) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// convert dp to pixel. | |
function dpToPixel(dp) { | |
return ( parseInt(dp) * (Titanium.Platform.displayCaps.dpi / 160)); | |
} | |
// convert pixel to dp. | |
function pixelToDp(px) { | |
return ( parseInt(px) / (Titanium.Platform.displayCaps.dpi / 160))+'dp'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost *:80> | |
ServerAdmin isl@m.magdy | |
ServerName js.io | |
ServerAlias js.io | |
ProxyRequests off | |
<Proxy *> | |
Order deny,allow | |
Allow from all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//acf stats repeater | |
array ( | |
'key' => 'field_5a27ee3a83076', | |
'label' => 'Stats', | |
'name' => 'stats', | |
'type' => 'repeater', | |
'instructions' => '', | |
'required' => 0, | |
'conditional_logic' => 0, | |
'wrapper' => array ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env bash | |
set -e | |
# This is based on the expo blogpost: | |
# https://blog.expo.io/automating-standalone-expo-app-builds-and-deployments-with-fastlane-exp-and-exptool-9b2f5ad0a2cd | |
# Publish `production` release to Expo | |
function publish_expo() { | |
# Log into Expo when running in CI | |
# Locally you should already be logged in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
check process hhvm with pidfile /var/run/hhvm/pid | |
group hhvm | |
start program = "/usr/sbin/service hhvm start" with timeout 60 seconds | |
stop program = "/usr/sbin/service hhvm stop" | |
if failed unixsocket /var/run/hhvm/hhvm.sock then restart | |
if mem > 400.0 MB for 1 cycles then restart | |
if 5 restarts with 5 cycles then timeout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (preg_match('~MSIE|Internet Explorer~i', $_SERVER['HTTP_USER_AGENT']) || (strpos($_SERVER['HTTP_USER_AGENT'], 'Trident/7.0; rv:11.0') !== false)) { | |
//is IE 11 or below | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .gitignore file for WordPress that ignores everything except: | |
# | |
# - .gitignore | |
# - favicon.ico | |
# - wp-config.php | |
# - everything in mu-plugins | |
# - my-plugin | |
# - my-theme (except for .sass-cache) | |
# | |
# based on https://gist.github.com/jdbartlett/444295 |
MailChimp's default popup scripts can break on WordPress sites that use jQuery/jQuery UI unless you include their embed code as the final elements before the closing body tag.
Including them in this way isn't always possible or easy with WordPress.
The code below is an alternative implementation of the loader that forces MailChimp's popup scripts to appear below all other scripts upon page load.
To use it, modify the baseUrl
, uuid
, and lid
attributes with the ones from the original popup script that MailChimp supplies.
OlderNewer