Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block yehosef

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
yehosef / optimization.php
Last active Oct 7, 2018
RF interview followup
View optimization.php
$series_sizes = [10, 100, 200, 300, 1000, 10000];
//$series_sizes = [10, 100];
$range_max = 3;
foreach ($series_sizes as $series_size)
$series_arr[$series_size] = generate_series($series_size, $range_max * -1, $range_max);
View test.sql
set @sum=0;
select mea1_count, num_members, @sum:=@sum+num_members from (
count(mem_id) num_members
count( mea1_count
yehosef / 0_reuse_code.js
Last active Aug 29, 2015
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
yehosef /
Last active Aug 29, 2015
delete files smaller than x b
find . -size -$1b -delete
yehosef /
Last active Aug 29, 2015
organized files by date
years=`seq 2014 2015`
months=`seq -w 01 12`
for year in ${years[@]}; do
mkdir $year
for month in ${months[@]}; do
mkdir $year/$month
mv $year-$month-* $year/$month
yehosef / show all
Last active Aug 29, 2015
show console colors for tmux
View show all
#!/usr/bin/env bash
for i in {0..255} ; do printf "\x1b[38;5;${i}mcolour${i}\n"; done
yehosef / query.json
Last active Nov 22, 2016
elasticsearch avg problem
View query.json
"size": 0,
"query": {
"filtered": {
"query": {
"query_string": {
"query": "*",
"analyze_wildcard": true
yehosef / es_position_offset_gap_test
Last active Aug 29, 2015
elasticsearch position_offset_gap on objects
View es_position_offset_gap_test
DELETE /test
PUT /test
"mappings": {
"nospace": {
"properties": {
"id": {
"type": "integer"
yehosef / post-checkout
Last active Dec 19, 2016
git hook to update composer dependencies only if changed, and to put the current revision in a file
View post-checkout
#set -x
yehosef / gist:57df0ec37d5096222cf0
Last active Aug 29, 2015 — forked from remy/gist:350433
check for localStorage support and if its not there, make a polyfill based on cookies
View gist:57df0ec37d5096222cf0
// refer to
try {
if (!window.localStorage || !window.sessionStorage) throw "exception";
localStorage.setItem('storage_test', 1);
} catch(e) {
(function () {
var Storage = function (type) {
You can’t perform that action at this time.