Skip to content

Instantly share code, notes, and snippets.

View luosky's full-sized avatar

Luosky luosky

View GitHub Profile
@adapptor-kurt
adapptor-kurt / idb-workaround.py
Created August 14, 2020 01:12
Helps Flipper connect to physical iOS devices more reliably.
#!/usr/bin/env python3
# See https://github.com/facebook/flipper/issues/262
import os
import sys
import syslog
import shlex
import time
import subprocess
@tehprofessor
tehprofessor / karabiner-fix.sh
Created July 4, 2019 18:03
Karabiner Elements "Fix-It" for Catalina Beta
#!/bin/sh
KARABINER_ELEMENTS_PATH="/Applications/Karabiner-Elements.app"
echo "Killing Karabiner & associated processes"
sudo pkill -f Karabiner -9 # Kills the main Karabiner UI
sudo pkill -f karabiner -9 # Kills the background processes
echo "Starting Karabiner-Elements... It may be up to a minute after opening Karabiner-Elements before your custom keys activate."
open $KARABINER_ELEMENTS_PATH # Open it back up!
@willwhui
willwhui / Connect to Google Home
Created June 1, 2017 13:57
Connect to Google Home
Connect to Google Home
@koaning
koaning / tf.py
Created March 9, 2017 16:13
tensorflow layer example
import tensorflow as tf
import numpy as np
import uuid
x = tf.placeholder(shape=[None, 3], dtype=tf.float32)
nn = tf.layers.dense(x, 3, activation=tf.nn.sigmoid)
nn = tf.layers.dense(nn, 5, activation=tf.nn.sigmoid)
encoded = tf.layers.dense(nn, 2, activation=tf.nn.sigmoid)
nn = tf.layers.dense(encoded, 5, activation=tf.nn.sigmoid)
nn = tf.layers.dense(nn, 3, activation=tf.nn.sigmoid)
@dalemanthei
dalemanthei / init.lua
Last active March 12, 2017 08:21
Hamerspoon config examples for hyper key
-- hattip https://github.com/lodestone/hyper-hacks
-- hattip https://gist.github.com/ttscoff/cce98a711b5476166792d5e6f1ac5907
-- hattip https://gist.github.com/prenagha/1c28f71cb4d52b3133a4bff1b3849c3e
-- A global variable for the Hyper Mode
k = hs.hotkey.modal.new({}, "F17")
-- The following keys are configured as hot keys in their respective apps (or in Keyboard Maestro)
-- d → Dash (configure in Dash preferences)
@wujichao
wujichao / keyCommand.m
Last active June 20, 2016 04:13
UIKeyCommand
//用法
xxxxxxButton.mgj_keyCommand = @"2";
-> ctrl + 2 //UIKeyModifierControl
// UIButton+UIKeyCommand
static char *kKeyCommandAssociatedObjectKey;
@interface UIButton (UIKeyCommand)
@property (nonatomic, strong) NSString *mgj_keyCommand;
@end
@implementation UIButton (UIKeyCommand)
@cyndibaby905
cyndibaby905 / NSNUll+ InternalNullExtention.m
Created March 28, 2014 09:23
NSNUll+ InternalNullExtention.m
#define NSNullObjects @[@"",@0,@{},@[]]
@interface NSNull (InternalNullExtention)
@end
@implementation NSNull (InternalNullExtention)
@xaviershay
xaviershay / github_requests.md
Last active April 11, 2018 03:20
Pull request feature requests

Hello Github,

Pull requests are not serving me well on large reviews. Here are some problems and suggested enhancements that would make me happy.

  • Mark comment as "resolved" (see google docs for an example). As code changes, comments get lost or made redundant, and it is not clear (to either the author or reviewers) which are still relevant and which have been addressed. Resolving a comment doesn't need to make it dissappear, but I need to be able to see "which comments have not been addressed" somehow. This feature would be the most useful to me.
  • Reply to a comment. This can be done in effect on line comments (assuming there is only one), but cannot on PR comments. Particularly with many threads, the lack of this makes a review hard to follow.
  • Explicit "approve/block" life cycle. The block is actually more important to me ... often on a PR that has been incrementally improved I want to "block" final merge of it until I get a chance to rebase/squash and generally pretty it up. The block can be over
@raven
raven / Breakpoints_v2.xcbkptlist
Last active August 30, 2019 00:53
Symbolic breakpoint for dynamically linking libReveal against UIApplicationMain
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
type = "2"
version = "2.0">
<Breakpoints>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.SymbolicBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
@branneman
branneman / better-nodejs-require-paths.md
Last active April 27, 2024 04:16
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

const Article = require('../../../../app/models/article');

Those suck for maintenance and they're ugly.

Possible solutions