Skip to content

Instantly share code, notes, and snippets.

View antpaw's full-sized avatar
♟️

Anton Pawlik antpaw

♟️
View GitHub Profile
@antpaw
antpaw / index.js
Last active April 3, 2019 08:29
Get Country ISO codes with translated names
// https://laendercode.net/de/2-letter-list.html
var table = document.querySelectorAll('.table')[0]
var codes = [].slice.call(table.querySelectorAll("h4")).map(function(elem) { return elem.innerText; })
var names = [].slice.call(table.querySelectorAll("td:last-child a")).map(function(elem) { return elem.innerText; })
var object = codes.map(function(code, i) { return {code, name: names[i]}; })
var elem = document.createElement("textarea");
elem.cols = "100";
@antpaw
antpaw / extensions.json
Last active April 13, 2020 10:35
Unity default config .vscode dir
{
// See http://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
// List of extensions which should be recommended for users of this workspace.
"recommendations": [
"ms-dotnettools.csharp",
"leopotam.csharpfixformat",
"streetsidesoftware.code-spell-checker",
"unity.unity-debug",
"editorconfig.editorconfig",

Keybase proof

I hereby claim:

  • I am antpaw on github.
  • I am antpaw (https://keybase.io/antpaw) on keybase.
  • I have a public key ASApNfShXCNGe-HzlXoo1kWmgxHrwN_wGoAP1Xqn5Nz_ego

To claim this, I am signing this object:

@antpaw
antpaw / snippets.json
Created June 25, 2018 11:31
VS Code snippets
{
"css": {
"snippets": {
"display": "display: ${1:block}"
}
}
}
wc -l $(find . -iname '*.FILE_EXT')
@antpaw
antpaw / regex
Created January 9, 2017 21:52
Replace Ruby's "key => value" to "key: value"
:([^\s\'\"]+)?(\s|)=>
$1:
#'.active.pane':
# 'escape': 'autocomplete:toggle'
#'.workspace .editor:not(.mini)':
# 'cmd-<': 'native!'
# 'shift-cmd-C': 'color-picker:open'
'body':
'ctrl-shift-2': 'toggle-quotes:toggle'
'ctrl-i': 'window:toggle-invisibles'
@antpaw
antpaw / snippets.cson
Last active December 10, 2015 12:42
atom ~/.atom/snippets.cson
'.source.coffee':
'Require underscore':
'prefix': 'r_'
'body': "_ = require('underscore')$1"
'Require Backbone':
'prefix': 'rb'
'body': "Backbone = require('backbone')$1"
'Require jQuery':
'prefix': 'rj'
'body': "$ = require('jquery')$1"
@antpaw
antpaw / Gruntfile.coffee
Created June 23, 2015 17:31
Tasks for creating an assetpipline for Coffee (browserified) and SASS assets
'use strict'
module.exports = (grunt) ->
# Project configuration.
destCss = 'public/css/'
destJs = 'public/js/'
src = 'src/'
externalLibs = [ 'npm-zepto', 'jquery' ]
grunt.initConfig(
@antpaw
antpaw / toCharCode.js
Created April 12, 2011 20:20
useful for String.fromCharCode();
String.prototype.toCharCode = function(){
var str = this.split('');
var work = [];
for (var i = 0; i < str.length; ++i){
work.push(str[i].charCodeAt(0));
}
return work;
};
console.log('test'.toCharCode().join(','));