Skip to content

Instantly share code, notes, and snippets.

🔭

Gilad Peleg pgilad

🔭
Block or report user

Report or block pgilad

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
View How we use cloudfront and next.js.md

How we incorporate next and cloudfront (2018-04-21)

Feel free to contact me at robert.balicki@gmail.com or tweet at me @statisticsftw

This is a rough outline of how we utilize next.js and S3/Cloudfront. Hope it helps!

It assumes some knowledge of AWS.

Goals

View docker-compose.yaml
version: '2.1'
services:
grafana:
container_name: grafana
image: proxx/grafana-armv7
user: "1000"
ports:
- 3000:3000
volumes:
- /opt/grafana:/etc/grafana:rw
@pgilad
pgilad / Instructions.md
Last active Sep 23, 2019
Generate SSL Certificate for use with Webpack Dev Server (OSX)
View Instructions.md

Generate private key

$ openssl genrsa -out private.key 4096

Generate a Certificate Signing Request

openssl req -new -sha256 \
@ggarcia24
ggarcia24 / pipeline.gdsl
Last active Oct 21, 2019
GDSL supporting pipeline declarative
View pipeline.gdsl
//The global script scope
def ctx = context(scope: scriptScope())
//What things can be on the script scope
contributor(ctx) {
method(name: 'pipeline', type: 'Object', params: [body: Closure])
property(name: 'params', type: 'org.jenkinsci.plugins.workflow.cps.ParamsVariable')
property(name: 'env', type: 'org.jenkinsci.plugins.workflow.cps.EnvActionImpl.Binder')
property(name: 'currentBuild', type: 'org.jenkinsci.plugins.workflow.cps.RunWrapperBinder')
property(name: 'scm', type: 'org.jenkinsci.plugins.workflow.multibranch.SCMVar')
@pgilad
pgilad / word_count.hs
Created Dec 16, 2017
Dictionary word count in Haskell
View word_count.hs
import Data.List
import qualified Data.Map.Strict as Map
import Data.Ord (comparing)
wordFrequency :: (Ord a) => [a] -> Map.Map a Int
wordFrequency xs = foldr (\word acc -> Map.insertWith (+) word 1 acc) Map.empty xs
nBiggest :: Int -> Map.Map a Int -> [(a, Int)]
nBiggest n m = take n $ sortBy (comparing $ negate . snd) $ Map.toList m
@boneskull
boneskull / README.md
Last active Aug 26, 2019
example of how to debug mocha v4 if hanging
View README.md

Here's an example of how to debug Mocha v4 if it hangs.

Ensure you're using a Node.js 8 or newer (or any version with async_hooks support).

If you run your test, you'll notice it hangs:

$ mocha test.js
@tombigel
tombigel / README.md
Last active Oct 20, 2019 — forked from a2ikm/limit.maxfiles.plist
How to Change Open Files Limit on OS X and macOS Sierra (10.8 - 10.12)
View README.md

How to Change Open Files Limit on OS X and macOS

This text is the section about OS X Yosemite (which also works for macOS Sierra) from https://docs.basho.com/riak/kv/2.1.4/using/performance/open-files-limit/#mac-os-x

The last time i visited this link it was dead (403), so I cloned it here from the latest snapshot in Archive.org's Wayback Machine https://web.archive.org/web/20170523131633/https://docs.basho.com/riak/kv/2.1.4/using/performance/open-files-limit/

Mac OS X

To check the current limits on your Mac OS X system, run:

@qoomon
qoomon / TravisGitHub.md
Last active Sep 15, 2019
Setup GitHub Deploy Keys For Travis
View TravisGitHub.md

Setup Travis Deploy (macOS)

gem install travis

ssh-keygen -t rsa -b 4096 -f 'github_deploy_key' -N ''

cat github_deploy_key.pub | pbcopy

set public key as deploy key on github e.g https://github.com/USER/REPO/settings/keys

rm 'github_deploy_key.pub'

@ozbillwang
ozbillwang / .travis.yml
Created Aug 1, 2017
terraform validates with Travis CI
View .travis.yml
env:
- tf_version=0.8.8
- tf_version=0.9.11
sudo: required
language: bash
before_install:
- wget https://releases.hashicorp.com/terraform/${tf_version}/terraform_${tf_version}_linux_amd64.zip -O /tmp/terraform.zip
@tanaikech
tanaikech / submit.md
Last active Oct 15, 2019
Multipart-POST Request Using Node.js
View submit.md

Multipart-POST Request Using Node.js

Here, I introduce 2 scripts for uploading files to Slack using Node.js as samples. These 2 sample scripts are for uploading files to Slack.

Sample script 1:

  • You can upload the zip file by converting byte array as follows.
    • At first, it builds form-data.
    • Adds the zip file converted to byte array and boundary using Buffer.concat().
    • This is used as body in request.
You can’t perform that action at this time.