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
/* global IntersectionObserver */ | |
(function () { | |
'use strict' | |
var selectors = '.home-hero, .site-header__logo' | |
function callback (entries) { | |
var entry = entries[0] | |
$(entry.target).css('animation', entry.isIntersecting ? '' : 'none') |
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
require 'json' | |
all_chars = {} | |
Dir["**/*.md"].each do |file| | |
character_data = IO.read(file).each_char.each_with_object(Hash.new(0)) do |word,counts| | |
counts[word] += 1 | |
end | |
all_chars.merge!(character_data) do |_, oldval, newval| |
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
import $ from "jquery"; | |
export default class ElementFilter { | |
constructor(container, elementSelector, searchSelectors) { | |
this.container = container || $(document); | |
this.elementSelector = elementSelector; | |
this.searchSelectors = searchSelectors; | |
} |
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
"use strict"; | |
const GuessTheNumber = require('./guess_the_number'); | |
module.exports = class GuessTheNumberSolver { | |
constructor() { | |
this.game = new GuessTheNumber(); | |
} |
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
"use strict"; | |
let readline = require('readline'); | |
class GuessTheNumber { | |
randomBetween(min, max) { | |
return Math.floor(Math.random() * (max - min + 1) + min); | |
} |
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
#!/bin/bash | |
HOOKS_DIR=$(dirname $(readlink -f $0))/../.git/hooks | |
echo Linking git hooks | |
cd $HOOKS_DIR | |
find ../../git_hooks/global/ -type f -not -name .keep | while read FILE; do | |
BASE_FILE=$(basename $FILE) | |
if [ ! -e $BASE_FILE ]; then |
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
#!/bin/bash | |
export GITHUB_USERNAME=lesleh | |
export GITHUB_PASSWORD=hunter2 | |
export DB_ROOT_PASSWORD=password | |
# Delete the next two lines when you're done | |
>&2 echo "YOU NEED TO SET THE VARIABLES BEFORE RUNNING THE SCRIPT.." | |
exit 1 |
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
# nginx | |
description "nginx http daemon" | |
author "George Shammas <georgyo@gmail.com>" | |
start on (filesystem and net-device-up IFACE=lo) | |
stop on runlevel [!2345] | |
env DAEMON=/opt/nginx/sbin/nginx | |
env PID=/opt/nginx/logs/nginx.pid |
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
#!/bin/bash | |
# Example usage: ./each_repo.sh 'git pull' | |
if [ $# -ne 1 ]; then | |
2>&1 echo "No command specified." | |
exit 1 | |
fi | |
DIR=$(pwd) # $(dirname $(readlink -f $0)) |
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
#!/bin/bash | |
DIR=$(dirname $(readlink -f $0)) | |
find $DIR -maxdepth 2 -mindepth 2 -name .git -type d | while read REPO; do | |
REPO=${REPO//.git/} | |
echo $REPO | |
pushd $REPO >/dev/null | |
git status -s |