Skip to content

Instantly share code, notes, and snippets.

View 0xch4z's full-sized avatar
🪣

Charlie Kenney 0xch4z

🪣
View GitHub Profile
#!/usr/bin/env bash
image_name=$1
docker run /
--rm / # automatically removes the container if it exists
-i / # interactive; keep STDIN open
-t / # tty mode
-v $(pwd):/usr/src/app / # bind container volume (<host>:<container>)
-w /usr/src/app / # workdir
module.exports = {
shell: 'C:\\Program Files\\Git\\git-cmd.exe',
shellArgs: ['--command=usr/bin/bash.exe', '-l', '-i'],
env: {
TERM: 'cygwin',
},
};
$RegistryKeyPath = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock"
if (-not(Test-Path -Path $RegistryKeyPath)) {
New-Item -Path $RegistryKeyPath -ItemType Directory -Force
}
New-ItemProperty -Path $RegistryKeyPath -Name AllowDevelopmentWithoutDevLicense -PropertyType DWORD -Value 1
Enable-WindowsOptionalFeature -FeatureName Microsoft-Windows-Subsystem-Linux -Online -All -LimitAccess -NoRestart

plain object with variant data

const variants = [
	{
	  name: 'california_only',
	  bannerImageUri: '/beach.jpg',
	  bannerHeadline: 'Wooo Califronia!!!'
	},
	{
 name: 'north_carolina_only',
#!/usr/bin/bash
FFMPEG=$(which ffmpeg)
if ! [ -x "$(command -v ffmpeg)" ]; then
echo "ffmpeg is not installed\nrun:\n\t$ brew install ffmpeg"
exit 1
fi
#offCanvasLeft li[aria-label="Things to do"]>ul>div>li:nth-child(-n+4):before,
#offCanvasLeft li[aria-label="Plan Your Visit"]>ul>div>li:nth-child(-n+5):before,
#offCanvasLeft li[aria-label="World Famous Studio Tour"]>ul>div>li:nth-child(-n+5):before,
#offCanvasLeft li[aria-label="VIP Experience"]>ul>div>li:nth-child(-n+5):before {
display: block;
content: ' ';
background: url('https://www.universalstudioshollywood.com/site-content/uploads/2017/07/2800x1197_FF_Studio_Tour.jpg');
height: 105px;
margin-right: 25px;
width: calc(100% - 25px);
const parse = require('csv-parse/lib/sync'),
fs = require('fs');
const rawCsv = fs.readFileSync('../Desktop/foo.csv');
const urls = parse(rawCsv)
.filter(rows => rows.length >= 2)
.map(rows => rows[1])
.map(row => row.trim())
.filter(str => /^https?/.test(str))
@0xch4z
0xch4z / addDynamicEventListener.js
Last active May 11, 2018 16:24
JQuery like event delegation for vanilla JS.
/**
* helper function for event delegation
*
* @param {string} event - event name
* @param {string} selector - selector for element
* @param {(Event) => void} callback - callback to invoke with click event
*/
const addDynamicEventListener = (event, selector, handler) => {
const _handler = function (e) {
let target = e.target;
/**
* @param {Number} maxTries - max tries polling for store
* @return {Promise<Redux.Store>} store
*
* @example
* (async function() {
* const store = await window.getReactReduxStore();
* store.subscribe(() => {
* console.log('store updated =>', store);
* });
#!/usr/bin/env bash
snippet_dir="~/Library/Developer/Xcode/UserData/CodeSnippets/"
op="mv"
function show_help() {
echo "
xc-source-snippets
sources xcode plist snippets to xcode user data