Skip to content

Instantly share code, notes, and snippets.

View radex's full-sized avatar
🚀
Full reusability

Radek Pietruszewski radex

🚀
Full reusability
View GitHub Profile
Only in /oldrepo: .DS_Store
Files /oldrepo/.git/COMMIT_EDITMSG and /newrepo/.git/COMMIT_EDITMSG differ
Files /oldrepo/.git/FETCH_HEAD and /newrepo/.git/FETCH_HEAD differ
Files /oldrepo/.git/ORIG_HEAD and /newrepo/.git/ORIG_HEAD differ
Files /oldrepo/.git/config and /newrepo/.git/config differ
Files /oldrepo/.git/fork-settings and /newrepo/.git/fork-settings differ
Files /oldrepo/.git/hooks/fsmonitor-watchman.sample and /newrepo/.git/hooks/fsmonitor-watchman.sample differ
Files /oldrepo/.git/hooks/pre-commit.sample and /newrepo/.git/hooks/pre-commit.sample differ
Files /oldrepo/.git/hooks/pre-push.sample and /newrepo/.git/hooks/pre-push.sample differ
Only in /newrepo/.git/hooks: push-to-checkout.sample
Only in /oldrepo: .DS_Store
Only in /oldrepo/.git: .watchman-cookie-RadPro.local-1030-20086
Only in /oldrepo/.git: .watchman-cookie-RadPro.local-1030-20087
Only in /oldrepo/.git: .watchman-cookie-RadPro.local-1030-20088
Only in /oldrepo/.git: .watchman-cookie-RadPro.local-1030-20089
Only in /oldrepo/.git: .watchman-cookie-RadPro.local-1030-20090
Only in /oldrepo/.git: .watchman-cookie-RadPro.local-1030-20091
Only in /oldrepo/.git: .watchman-cookie-RadPro.local-1030-20092
Only in /oldrepo/.git: .watchman-cookie-RadPro.local-1030-20093
Files /oldrepo/.git/COMMIT_EDITMSG and /newrepo/.git/COMMIT_EDITMSG differ
@radex
radex / error.stack.js
Created March 18, 2021 10:54
error.stack contents on modern Chrome, Safari, Firefox
# Chrome 91
"Uncaught Error: you got Bard"
"http://localhost:4000/static/main.1e33ab4c.js"
26
11
error.stack = "Error: you got Bard
at new Bar (http://localhost:4000/static/main.1e33ab4c.js:26:11)
at foo (http://localhost:4000/static/main.1e33ab4c.js:32:3)
// ModuleGraph/worker/JSFileWrapping.js
function normalizeFileName(name) {
return '_' + name.replace(/[^a-zA-Z0-9]/g, '_')
}
function wrapModule(
// ...
, fileName) {
// ...
// @flow
import { map, is } from 'rambdax'
import type { DirtyRaw } from '@nozbe/watermelondb/RawRecord'
import type { SyncLog } from '@nozbe/watermelondb/sync'
// beginning, end, length
const censorValue = (value: string): string =>
`${value.slice(0, 2)}***${value.slice(-2)}(${value.length})`
const shouldCensorKey = (key: string): boolean =>
1. set up a Prefetcher instance, for example in your router component
2. when you want to display another part of the app, call:
```
prefetcher.prefetch(screenConcretePrefetcher, 'my-screen', () => {
// prefetch done! you can call setState() or whatever to actually start rendering a tree
})
```
@radex
radex / tadam-es.strings
Last active June 14, 2018 14:19
This is my best take on translating strings for Tadam http://tadamapp.com into Spanish. If you're a native Spanish speaker, please send corrections! Much appreciated 🙏
/* !!! As always: you don't have to translate verbatim. Feel free to change things a bit if it makes more sense in a language, as long as you keep the meaning. */
/* ## new timer view ## */
/* New timer */
"new_timer.title" = "Nuevo temporizador";
/* Go! */
"go.title" = "Iniciar";
/* ## change time view ## */
/* Change time */
"change_time.title" = "Cambiar tiempo";
extension NSRegularExpression {
func capturedGroups(forString string: String) -> [String?]? {
let nsString = string as NSString
let stringRange = NSRange(location:0, length: nsString.length)
// Match
guard let result = firstMatchInString(string, options: [], range: stringRange) else {
return nil
}
post_install do |installer|
installer.pods_project.build_configurations.each do |configuration|
configuration.build_settings['SWIFT_VERSION'] = '2.3'
configuration.build_settings['PROVISIONING_PROFILE_SPECIFIER'] = 'WT398A4BZ6/' # replace with your Team ID
end
end
@radex
radex / extract-methods.rb
Created February 11, 2016 11:32
Extract function declarations from your Swift project. Just open up `irb` from your project run and paste this:
IO.write 'funcs.txt', (Dir["**/*.swift"] - Dir["{Libraries,Pods}/**/*.swift"]).flat_map { |f| IO.read(f).lines.select { |l| l.include? 'func ' }.map { |l| l.strip } }.join("\n")