Go to the egghead website, i.e. Building a React.js App
run
$.each($('h4 a'), function(index, video){
console.log(video.href);
});
#!/bin/bash | |
# Recursive file convertion windows-1251 --> utf-8 | |
# Place this file in the root of your site, add execute permission and run | |
# Converts *.php, *.html, *.css, *.js files. | |
# To add file type by extension, e.g. *.cgi, add '-o -name "*.cgi"' to the find command | |
find ./ -name "*.php" -o -name "*.html" -o -name "*.css" -o -name "*.js" -type f | | |
while read file | |
do |
prompt:/# kvm -version | |
QEMU emulator version 2.9.0 (v2.9.0-dirty) | |
Copyright (c) 2003-2017 Fabrice Bellard and the QEMU Project developers | |
prompt:/# uname -a | |
Linux ThinkPad-P50 4.13.8-041308-generic #201710180430 SMP Wed Oct 18 08:33:18 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux |
Go to the egghead website, i.e. Building a React.js App
run
$.each($('h4 a'), function(index, video){
console.log(video.href);
});
Install OS X El Capitan
is createdgem 'browserify-rails', '1.5.0' # until fix: https://github.com/browserify-rails/browserify-rails/issues/101
gem 'react-rails'
Browserify-rails allows to use browserify within assets pipeline. React-rails is here only to allow to use #react_component
(and thus, prerendering).
Note that jquery-rails
can be removed from Gemfile, the npm version of jquery
and jquery-ujs
will be used instead.
After reading Code Climate's Rails' Insecure Defaults I realized I was guilty of breaking rule 3. Versioned Secret Tokens. Here's how I fixed it.
Use dotenv in development and test environments:
# Gemfile
gem 'dotenv-rails', groups: [:development, :test]
+ (instancetype)sharedInstance | |
{ | |
static dispatch_once_t once; | |
static id sharedInstance; | |
dispatch_once(&once, ^{ | |
sharedInstance = [[self alloc] init]; | |
}); | |
return sharedInstance; | |
} |
class Integer | |
N_BYTES = [42].pack('i').size | |
N_BITS = N_BYTES * 16 | |
MAX = 2 ** (N_BITS - 2) - 1 | |
MIN = -MAX - 1 | |
end | |
p Integer::MAX #=> 4611686018427387903 | |
p Integer::MAX.class #=> Fixnum | |
p (Integer::MAX + 1).class #=> Bignum |
#!/bin/bash | |
find "$1" -type f -name "*.ape" -print0 | while read -d $'\0' song | |
do | |
output=${song%.ape}.mp3 | |
cue=${song%.ape}.cue | |
avconv -i "$song" -b 192k "$output" | |
if ls "$cue" &> /dev/null; then | |
mp3splt -a -c "$cue" "$output" |