Skip to content

Instantly share code, notes, and snippets.

View gabrielcsapo's full-sized avatar
💻
In the matrix

Gabriel Csapo gabrielcsapo

💻
In the matrix
View GitHub Profile
@gabrielcsapo
gabrielcsapo / update-assert-expect.js
Created April 11, 2023 23:49
jscodeshift update assert.expect
export default function transformer(file, api) {
const j = api.jscodeshift;
return j(file.source)
.find(j.CallExpression, {
callee: {
type: 'Identifier',
name: 'test',
},
})
@gabrielcsapo
gabrielcsapo / commit_case_sensitive_filename_changes
Created April 23, 2021 20:03
Show to how to commit case sensitive changes to git
git config core.ignorecase false
git rm -rf --cached .
git add -A
@gabrielcsapo
gabrielcsapo / index.js
Last active April 20, 2023 21:51
removes all eslint-disable comments
const fs = require('fs');
const walkSync = require('walk-sync');
const workerpool = require('workerpool');
const os = require('os');
const chalk = require('chalk');
const maxWorkers = Math.ceil(os.cpus().length / 3);
const pool = workerpool.pool(`${__dirname}/worker.js`, {
maxWorkers,
import Controller from '@ember/controller';
export default class ApplicationController extends Controller {
appName = 'Ember Twiddle';
}
@gabrielcsapo
gabrielcsapo / gist:bf8bdc3f6f2193d881b9dabd669b3c44
Created December 26, 2016 22:22
remove all branches except master
git branch | grep -v "master" | xargs git branch -D
@gabrielcsapo
gabrielcsapo / gist:63e41dd1620d5e41cfb662c1eb953c50
Created December 8, 2016 18:00
create an html table from a javascript object
var obj = [{
"key": "apple",
"value": 1.90,
"category": ["food", "fruit"],
"nutrition": {
"calories": 10
}
}, {
"key": "berry",
"value": 1.7

flow.txt

hello
require('flow.txt'); // hello

fs.writeSync('flow.txt', 'helloagain');
@gabrielcsapo
gabrielcsapo / gist:fd5eb7245e37c26998c3
Created May 11, 2015 17:35
To not show application top bar for cocoa
Application is agent (UIElement) = YES
#!/usr/bin/env sh
#
# This script automates images optimization
# is mainly used by a developer who manually
# can execute it when adding new images to the
# project
#
# Download and compile following binaries:
#
# - [jpegtran](http://www.ijg.org/)
@gabrielcsapo
gabrielcsapo / gist:7f7b4eb8b569fc911e82
Created April 30, 2015 23:15
set background color for NSButton
// NSColor *color = [NSColor colorWithCalibratedRed:0.121f green:0.4375f blue:0.1992f alpha:0.2578f];
//
// [btnAdd setWantsLayer:YES];
// btnAdd.layer.backgroundColor = color.CGColor;