Skip to content

Instantly share code, notes, and snippets.

View usmonster's full-sized avatar
🫖

Usman usmonster

🫖
  • Paris, New York, Internet
View GitHub Profile
@usmonster
usmonster / lp2gh-vesuvius.sh
Last active January 4, 2016 20:29
Steps to export Vesuvius from LP to GH. Result here: https://github.com/usmonster/vesuvius-test
# Steps to export Vesuvius from LP to GH.
# Replace [username] and ~/path/to/vesuvius with the appropriate values.
# NOTE: This is NOT a script, but a series of commands you should run by hand.
# Also, much of this was found on http://flexion.org/posts/2012-10-migrating-bzr-to-git.html .
# get the tools
sudo apt-get update
sudo apt-get install bzr-fastimport # adds fast-export to bzr if you don't already have it
sudo apt-get upgrade git # make sure git is the most current!
@Raynos
Raynos / a.md
Created January 23, 2012 19:48
Shim status of ES6

ES6 what can be shimmed and what not.

Currently only lists things that can be shimmed or are experimentally implemented

Note that for any kind of decent ES6 support we need an ES6 transpiler. A few projects are attempting this [Reference SO question][3]

  • [traceur][4]
  • [Caja][5]
  • [ES transpiler][6]
@Whitespace
Whitespace / cleanup.sh
Created August 28, 2012 22:56 — forked from jessedearing/cleanup.sh
Git branch cleanup
git checkout master
git fetch
git remote prune origin
git branch --merged master | grep -v 'master$' | xargs git branch -d
echo "The following remote branches are fully merged and will be removed:"
git branch -r --merged master | sed 's/ *origin\///' | grep -v 'master$'
git branch -r --merged master | sed 's/ *origin\///' | grep -v 'master$' | xargs -I% git push origin :%
@qmahoney
qmahoney / header.bash
Last active December 18, 2020 20:12
Fake Athena header page
#!/bin/bash
# Copy banner.ps and owl.ps from:
# http://athena10.mit.edu/trac/browser/trunk/third/lprng/athena?rev=13556
echo "/user (`whoami`) def" > vars.ps
echo "/host (`hostname`) def" >> vars.ps
echo "/queuejob () def" >> vars.ps
echo "/date (`date +"%A, %e %B %Y %H:%M:%S"`) def" >> vars.ps
echo "/motd () def" >> vars.ps
@afeld
afeld / slack_reactions.js
Last active September 18, 2021 19:59
get emoji reactions for a message in Slack – unfortunately their API "might not always contain all users that have reacted". limited to 50 as of 2/12/16.
'use strict';
const Promise = require('bluebird');
const WebClient = require('slack-client').WebClient;
const token = process.env.SLACK_API_TOKEN;
if (!token) {
throw "Please set SLACK_API_TOKEN";
}
@samwize
samwize / mocha-guide-to-testing.js
Created February 8, 2014 05:53
Explain Mocha's testing framework - describe(), it() and before()/etc hooks
// # Mocha Guide to Testing
// Objective is to explain describe(), it(), and before()/etc hooks
// 1. `describe()` is merely for grouping, which you can nest as deep
// 2. `it()` is a test case
// 3. `before()`, `beforeEach()`, `after()`, `afterEach()` are hooks to run
// before/after first/each it() or describe().
//
// Which means, `before()` is run before first it()/describe()
@endolith
endolith / frequency_estimator.py
Last active October 30, 2023 18:08
Frequency estimation methods in Python
from __future__ import division
from numpy.fft import rfft
from numpy import argmax, mean, diff, log, nonzero
from scipy.signal import blackmanharris, correlate
from time import time
import sys
try:
import soundfile as sf
except ImportError:
from scikits.audiolab import flacread
@aslafy-z
aslafy-z / Jenkinsfile
Last active December 13, 2023 19:52 — forked from rufoa/Jenkinsfile
Jenkins [skip ci] implementation for multi-branch declarative pipeline
pipeline {
...
stages {
stage('Run CI?') {
steps {
script {
if (sh(script: "git log -1 --pretty=%B | grep -F -ie '[skip ci]' -e '[ci skip]'", returnStatus: true) == 0) {
currentBuild.result = 'NOT_BUILT'
error 'Aborting because commit message contains [skip ci]'
@jonico
jonico / Jenkinsfile
Last active January 31, 2024 09:43
Example for a full blown Jenkins pipeline script with CodeQL analysis steps, multiple stages, Kubernetes templates, shared volumes, input steps, injected credentials, heroku deploy, sonarqube and artifactory integration, Docker containers, multiple Git commit statuses, PR merge vs branch build detection, REST API calls to GitHub deployment API, …
#!groovy
import groovy.json.JsonOutput
import groovy.json.JsonSlurper
def label = "mypod-${UUID.randomUUID().toString()}"
podTemplate(label: label, yaml: """
spec:
containers:
- name: mvn
image: maven:3.3.9-jdk-8
@mnapoli
mnapoli / behat-reference.feature
Last active February 12, 2024 10:54
Behat Mink reference
# Given
Given I am on [the] homepage
Given I am on "url"
# When
When I go to [the] homepage
When I go to "url"
When I reload the page