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
// executes a single function | |
function single(callback){ | |
callback(); | |
} | |
function b(){ | |
console.log("I'm b"); | |
} | |
function d(){ |
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 | |
#This script installs a ejabberd on centos7 | |
echo 'Updating packages...' | |
sudo yum update -y | |
echo 'Install wget' | |
sudo yum install wget -y | |
echo 'Download EPEL' |
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 | |
#removes older packages | |
sudo apt-get remove --purge mysql-server mysql-client mysql-common | |
sudo apt-get autoremove | |
sudo apt-get autoclean | |
#removes configuration files | |
sudo rm -rf /var/lib/mysql |
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
sudo -i -u postgres psql | |
CREATE DATABASE geonames; | |
DROP TABLE geoname; | |
CREATE TABLE geoname ( | |
geonameid int, | |
name varchar(200), | |
asciiname varchar(200), | |
alternatenames varchar(12000), |
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 | |
#This command lists all the ruby versions available for install. Make sure the ruby version you want to install is shown on the list | |
#In this case we will be looking to install 2.3.1 | |
rbenv install --list | |
#In case the ruby version (2.3.1) you want to install is not on the list, you will have to update both the rbenv | |
#and the ruby_build/plugin repositories | |
#Run the following two commands to update the corresponding git repositories (assuming both are installed inside your home folder) |
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
#For Ubuntu 16.04 LTS | |
#First you need to know where google-chrome is installed. To find out run: | |
which google-chrome | |
#For my case, google-chrome is installed inside both /usr/bin/google-chrome and /usr/bin/google-chrome-stable. | |
#I decided to use the stable version. | |
#Now, list the domains that you'd like chrome to treat as secure. Make sure that you have access to the folder following --user-data-dir. I used $HOME for convenience. | |
#Run the following command: |
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
const throttle = (func, limit) => { | |
let engaged = false; | |
return function () { | |
const args = arguments; | |
const context = this; | |
if (!engaged) { | |
func.apply(context, args); | |
engaged = true; | |
setTimeout(() => engaged = false, limit); | |
} |
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
f = File.stream!("Locations.csv") | |
%File.Stream{ | |
line_or_bytes: :line, | |
modes: [:raw, :read_ahead, :binary], | |
path: "Locations.csv", | |
raw: true | |
} | |
City |> Repo.all() |> Repo.preload([:county, county: [:state]]) |> Enum.map(&([&1.id, &1.county.state.id])) |> CSV.encode() |> Stream.into(f) |> Stream.run() |
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
version: "3" | |
networks: | |
cluster: | |
external: false | |
services: | |
proxy: | |
build: | |
context: . |
OlderNewer