Skip to content

Instantly share code, notes, and snippets.

@ikey4u
ikey4u / svg2icns.sh
Created February 27, 2020 03:36
Generate Mac icns icon from svg using inkscape
inkscape=/Applications/Inkscape.app/Contents/MacOS/inkscape
insvg=burpicon.svg
output=burp
outdir=${output}.iconset
mkdir $outdir
for sz in 16 32 128 256 512
do
echo "[+] Generete ${sz}x${sz} png..."
$inkscape --without-gui --export-file ${outdir}/icon_${sz}x${sz}.png -w $sz -h $sz $insvg
@kdembler
kdembler / apfsbug.md
Last active March 11, 2024 03:53
Fix League of Legends client not launching after champion select on macOS

The issue

After fresh install of League of Legends on macOS with case-sensitive APFS volume it's not possible to start League of Legends game, after champion selection the launcher won't open the game client and is stuck with reconnect button.

Solution

Terminal method is probably more reliable as you can see real file names within terminal opposite to Finder which "beautifies" them so you can't be sure what the actual file name is.

Note that League patcher will probably install updates under old filename so it's possible that these steps will need to be taken after every patch until Riot fixes it.

Terminal.app

  1. Open Terminal.app from Applications
  2. Browse to League contents with cd /Applications/League of Legends.app/Contents/LoL/RADS/solutions/lol_game_client_sln/releases/
@slipo
slipo / docker-compose.yml
Created January 30, 2018 23:00
Super simple docker compose file giving you a private NEO network and neon-wallet-db ... see comments.
version: '3'
services:
neon-wallet-db:
container_name: "neon-wallet-db"
image: slipoh/neon-wallet-db:latest
environment:
- MONGOURL=mongodb:27017
- MONGOPASS=neo
- MONGOUSER=gas
- MONGOAPP=test
@sterlingwes
sterlingwes / README.md
Last active April 4, 2018 06:05
Getting past cross-origin Web Worker exception

Cross-origin web worker scripts

If you're like me and wanted to serve your main app script from a CDN and still load a web worker, you may have encountered the following error:

Uncaught DOMException: Failed to construct 'Worker': Script at 'http://cdn.example.com/worker.js' cannot be accessed from origin 'http://example.com'

You can get around this fairly simply with importScripts by making the script you instantiate your worker with load the actual worker script from the CDN.

@ccnokes
ccnokes / preload-example.js
Created February 1, 2017 03:03
Electron preload script
// in preload scripts, we have access to node.js and electron APIs
// the remote web app will not have access, so this is safe
const { ipcRenderer: ipc, remote } = require('electron');
init();
function init() {
// Expose a bridging API to by setting an global on `window`.
// We'll add methods to it here first, and when the remote web app loads,
// it'll add some additional methods as well.
@brandonc
brandonc / batch_job_stateful.rb
Created February 18, 2016 23:05
Attach batch progress tracking to a model via concern
module BatchJobStateful
extend ActiveSupport::Concern
included do
field :current_batch_id, type: String
field :last_batch_total, type: Integer
field :last_batch_failures, type: Integer
field :last_batch_created_at, type: Time
field :last_batch_completed_at, type: Time
end
@thejmazz
thejmazz / .babelrc
Created February 16, 2016 18:17
async/await with webpack+babel
{
"presets": ["es2015"],
"plugins": ["transform-async-to-generator"]
}
@oelmekki
oelmekki / doc.md
Created December 30, 2015 19:37
Rails + Browserify + React + es7

1. Gemfile

gem 'browserify-rails', '1.5.0' # until fix: https://github.com/browserify-rails/browserify-rails/issues/101
gem 'react-rails'

Browserify-rails allows to use browserify within assets pipeline. React-rails is here only to allow to use #react_component (and thus, prerendering).

Note that jquery-rails can be removed from Gemfile, the npm version of jquery and jquery-ujs will be used instead.

@chantastic
chantastic / on-jsx.markdown
Last active March 20, 2024 01:03
JSX, a year in

Hi Nicholas,

I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I led the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:

The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can't

@killercup
killercup / Gulpfile.coffee
Created September 14, 2014 12:28
A Gulp config for compiling CoffeeScript and Less using Webpack with a custom vendor.js and Hot Module Replacement for Less and React.js
# # Frontend Build Process
path = require('path')
gulp = require('gulp')
gutil = require('gulp-util')
plumber = require('gulp-plumber')
webpack = require("webpack")
# ## CONSTS