This file contains hidden or 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
//Author: Felix Descoteaux | |
//Usage: $.sameheight($("#element1"), $(".element2"), ... ); | |
(function($) { | |
var sameHeight = function sameHeight() { | |
var arrayOfHeights = [], | |
arr = Array.prototype.slice.call(arguments), | |
max; | |
//Clear any height value |
This file contains hidden or 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
//allow double box shadows | |
@mixin box-shadow($shadow1, $shadow2:false) { | |
$params: $shadow1; | |
@if $shadow2 | |
{ $params: $shadow1, $shadow2; } | |
-webkit-box-shadow: $params; | |
-moz-box-shadow: $params; | |
box-shadow: $params; | |
} |
This file contains hidden or 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
import requests | |
import threading | |
from bs4 import BeautifulSoup | |
from Queue import Queue | |
import re | |
import time | |
max_page = 230 | |
num_workers = 200 | |
sentence_regex = re.compile(r'([^.!?(\n)+]+[.!?]+)') |
This file contains hidden or 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
//requires lodash | |
function preload(sources, chunkSize) { | |
chunkSize = chunkSize || sources.length; | |
var sourcesChunked = _.chunk(sources, chunkSize); | |
var steps = sourcesChunked.length; | |
var current = 0; | |
var inner = function(_current){ | |
var imagesTemp = []; | |
var l = sourcesChunked[_current].length; | |
var counter = 0; |
This file contains hidden or 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 [ -n "$INSIDE_EMACS" ]; then | |
chpwd() { print -P "\033AnSiTc %d" } | |
print -P "\033AnSiTu %n" | |
print -P "\033AnSiTc %d" | |
fi |
This file contains hidden or 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
extern crate libc; | |
use std::ffi::CStr; | |
use libc::c_char; | |
pub extern fn to_owned(buf: *const c_char) -> String { | |
let c_str: &CStr = unsafe { CStr::from_ptr(buf) }; | |
let buf: &[u8] = c_str.to_bytes(); | |
let str_slice: &str = std::str::from_utf8(buf).unwrap(); | |
str_slice.to_owned() |
This file contains hidden or 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
class MyLogger < Logger | |
def add(severity, message = nil, progname = nil) | |
severity ||= UNKNOWN | |
if @logdev.nil? or severity < @level | |
return true | |
end | |
if progname.nil? | |
progname = @progname | |
end | |
if message.nil? |
This file contains hidden or 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
#!/bin/bash | |
# shamelessly stolen from https://github.com/mat/dotfiles/blob/master/bin/curlt | |
# | |
# curl wrapper returning timing information. | |
# | |
# curl format adapted from | |
# http://josephscott.org/archives/2011/10/timing-details-with-curl/ | |
# | |
# Example usage: | |
# $ curlt http://www.apple.com |
This file contains hidden or 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
# Assets compilation | |
FROM aparedes/alpine-node-yarn as node | |
## Node modules | |
COPY ./deps /tmp/deps | |
COPY ./assets/package.json /tmp/deps | |
COPY ./assets/package-lock.json /tmp/deps | |
WORKDIR /tmp/deps | |
RUN yarn |
This file contains hidden or 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
" vim: set sw=2 ft=vim ts=2 sts=2 et: | |
""""""""""""""""""""""""""""""" | |
" => BUNDLES | |
""""""""""""""""""""""""""""""" | |
call plug#begin('~/.vim/plugged') | |
Plug 'MarcWeber/vim-addon-mw-utils' | |
Plug 'tomtom/tlib_vim' |
OlderNewer