Skip to content

Instantly share code, notes, and snippets.

@jonnyyu
jonnyyu / main.mm
Created February 7, 2014 03:25
check app is responding on Mac
//
// main.c
// AppStatusChecker
//
// Created by Jonny Yu on 1/23/14.
// Copyright (c) 2014 Jonny Yu. All rights reserved.
//
#include <CoreServices/CoreServices.h>
#include <ApplicationServices/ApplicationServices.h>
require 'formula'
class Llvm33 < Formula
homepage 'http://llvm.org/'
revision 1
stable do
url 'http://llvm.org/releases/3.3/llvm-3.3.src.tar.gz'
sha1 'c6c22d5593419e3cb47cbcf16d967640e5cce133'
using System;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
namespace MSBuildHelloWorldTask
{
public class HelloWorld : Task
{
[Required]
public string FirstName
@jonnyyu
jonnyyu / gist:825340ec485cfbf79e4e0b9a369dc9a1
Created April 5, 2017 11:35
fake a react-packager to avoid launching packager on CI
#!/usr/bin/ruby
require 'webrick'
server = WEBrick::HTTPServer.new(:Port => 8081)
server.mount_proc '/' do |req, res|
res.body = 'packager-status:running'
end
server.start
@jonnyyu
jonnyyu / save_lock_screen_images.bat
Created November 28, 2017 01:47
Save Windows Lock Screen Images
copy %userprofile%\AppData\Local\Packages\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\LocalState\Assets\*.* %userprofile%\Pictures\Windows_LockScreen
cd /d %userprofile%\Pictures\Windows_LockScreen
ren * *.jpg
This file has been truncated, but you can view the full file.
C:\Data2>git config --global --list
fatal: unable to read config file 'C:/Users/Administrator.ECS-BASE-WIN-20/.gitconfig': No such file or directory
C:\Data2>git config --system --list
http.sslcainfo=C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
http.sslbackend=openssl
diff.astextplain.textconv=astextplain
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process=git-lfs filter-process
@jonnyyu
jonnyyu / aurora_serverless.py
Last active March 8, 2020 03:02
Create Aurora Serverless in CDK
from typing import Optional, Union
import jsii
from aws_cdk import (
aws_ec2 as ec2,
aws_rds as rds,
aws_kms as kms,
aws_secretsmanager as secretsmanager,
core,
)
@jonnyyu
jonnyyu / config
Last active May 5, 2022 14:08 — forked from cliv/config
# add to ~/.aws/config and add the path to your folder.
[profile vscode]
region = us-west-2
credential_process = /home/ec2-user/.aws/get_credentials_vscode.sh
@jonnyyu
jonnyyu / json_utils.py
Last active August 23, 2022 06:38
json_utils
import json
def read_json(json_file):
with open(json_file, 'r', encoding='utf-8') as fi:
return json.load(fi)
def write_json(obj, json_file):
with open(json_file, 'w', encoding='utf-8') as fo:
json.dump(obj, fo)
@jonnyyu
jonnyyu / git_version.py
Last active August 23, 2022 06:39
get git tag version
import subprocess
def get_tag():
return subprocess.check_output(['git', 'describe', '--always'], cwd='json', encoding='utf-8').strip()