Skip to content

Instantly share code, notes, and snippets.

View sydcanem's full-sized avatar
🏠
Working from home

James Santos sydcanem

🏠
Working from home
View GitHub Profile
;;; js-beautify.el -- beautify some js code
(defgroup js-beautify nil
"Use jsbeautify to beautify some js"
:group 'editing)
(defcustom js-beautify-args "--jslint-happy --brace-style=end-expand --keep-array-indentation"
"Arguments to pass to jsbeautify script"
:type '(string)
:group 'js-beautify)
#EXTM3U
#EXT-X-TARGETDURATION:10
#EXT-X-ALLOW-CACHE:YES
#EXT-X-PLAYLIST-TYPE:VOD
#EXT-X-VERSION:3
#EXT-X-MEDIA-SEQUENCE:1
#EXTINF:10.000,
http://schoolimp-vh.akamaihd.net/i/PD360/media/video/PD360/1502S/1502S_7/1502S_7_,304,552,800,1152,1552,1952,2448,.mp4.csmil/segment1_0_av.ts
#EXTINF:10.000,
http://schoolimp-vh.akamaihd.net/i/PD360/media/video/PD360/1502S/1502S_7/1502S_7_,304,552,800,1152,1552,1952,2448,.mp4.csmil/segment2_0_av.ts
@sydcanem
sydcanem / Dialog.js
Last active August 29, 2015 14:06 — forked from ryanflorence/Dialog.js
var Dialog = React.createClass({
render: function() {
// 1) render nothing, this way the DOM diff will never try to do
// anything to it again, and we get a node to mess with
return React.DOM.div();
},
componentDidMount: function() {
// 2) do DOM lib stuff
this.node = this.getDOMNode();
@sydcanem
sydcanem / resolving_conflicts_in_merge.md
Last active August 29, 2015 14:06
Git: Resolving merge conflicts properly with git blame.

Resolving merge conflicts properly with git blame

Continuing with [github's guide to resolving merge conflicts.][1]

This guide will go through resolving merge conflicts that spans to multiple files and more than one people has made a change on the conflicted files. Usually this conflicts occurs when a feature/release branch has made changes to common files or modules that was also been changed on the dev branch.

Mac Homebrew (RVM/MySQL/Redis) setup

Follow the steps below to setup a local development environment:

XQuartz

Recommended to download latest XQuartz

iTerm2

Get Git log in JSON format

git log --pretty=format:'{%n  "commit": "%H",%n  "abbreviated_commit": "%h",%n  "tree": "%T",%n  "abbreviated_tree": "%t",%n  "parent": "%P",%n  "abbreviated_parent": "%p",%n  "refs": "%D",%n  "encoding": "%e",%n  "subject": "%s",%n  "sanitized_subject_line": "%f",%n  "body": "%b",%n  "commit_notes": "%N",%n  "verification_flag": "%G?",%n  "signer": "%GS",%n  "signer_key": "%GK",%n  "author": {%n    "name": "%aN",%n    "email": "%aE",%n    "date": "%aD"%n  },%n  "commiter": {%n    "name": "%cN",%n    "email": "%cE",%n    "date": "%cD"%n  }%n},'

The only information that aren't fetched are:

  • %B: raw body (unwrapped subject and body)
  • %GG: raw verification message from GPG for a signed commit
# Expire rules for static content
# cache.appcache, your document html and data
location ~* \.(?:manifest|appcache|html?|xml|json)$ {
expires -1;
# access_log logs/static.log; # I don't usually include a static log
}
# Feed
location ~* \.(?:rss|atom)$ {
@sydcanem
sydcanem / git-install.sh
Last active September 22, 2015 06:24
Git install from source on Centos7
sudo yum groupinstall "Development Tools"
sudo yum install gettext-devel openssl-devel perl-CPAN perl-devel zlib-devel curl-devel
wget https://github.com/git/git/archive/v2.5.1.tar.gz -O git.tar.gz
tar -zvf git.tar.gz
cd git-*
make configure
./configure --prefix=/usr/local
sudo make install
@sydcanem
sydcanem / fix-homebrew-npm.md
Created November 9, 2015 14:25 — forked from DanHerbert/fix-homebrew-npm.md
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew

Fixing npm On Mac OS X for Homebrew Users

If you just want to fix the issue quickly, scroll down to the "solution" section below.

Explanation of the issue

If you're a Homebrew user and you installed node via Homebrew, there is a major philosophical issue with the way Homebrew and NPM work together. If you install node with Homebrew and then try to do npm update npm -g, you may see an error like this:

$ npm update npm -g
@sydcanem
sydcanem / consul.service
Created December 18, 2015 07:35 — forked from yunano/consul.service
/etc/systemd/system/consul.service
[Unit]
Description=consul agent
Requires=network-online.target
After=network-online.target
[Service]
EnvironmentFile=-/etc/sysconfig/consul
Environment=GOMAXPROCS=2
Restart=on-failure
ExecStart=/usr/local/sbin/consul agent $OPTIONS -config-dir=/etc/consul.d