Skip to content

Instantly share code, notes, and snippets.

View ApolloZhu's full-sized avatar
🐣
Improving Swift Platform Experience

Zhiyu Zhu/朱智语 ApolloZhu

🐣
Improving Swift Platform Experience
View GitHub Profile
@my8bit
my8bit / stream.py
Created January 21, 2014 16:57
How to save youtube live stream. Python script which allows to save video by sequences
#!/usr/bin/python
# # # # # # # # # # # # # # # # # # # #
# #
# Script was made by Dennis #
# http://stefansundin.com/blog/452 #
# http://pastebin.com/8cw9LHFg #
# #
# # # # # # # # # # # # # # # # # # # #
/// custom unique identifier
/// @see https://www.firebase.com/blog/2015-02-11-firebase-unique-identifiers.html
private let ASC_CHARS = Array("-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz")
private let DESC_CHARS = ASC_CHARS.reverse()
private var lastPushTime: UInt64 = 0
private var lastRandChars = Array<Int>(count: 12, repeatedValue: 0)
func generatePushID(ascending: Bool = true) -> String {
let PUSH_CHARS = ascending ? ASC_CHARS: DESC_CHARS
var timeStampChars = Array<Character>(count: 8, repeatedValue: PUSH_CHARS.first!)
@Daemon-Devarshi
Daemon-Devarshi / PasteboardWatcher.swift
Last active October 6, 2023 14:15
A class which performs polling to determine the newly copied url of desired kind in an external app
//
// PasteboardWatcher.swift
// PasteboardWatcher
//
// Created by Devarshi Kulshreshtha on 6/19/15.PasteboardWatcher
// Copyright © 2015 Devarshi Kulshreshtha. All rights reserved.
//
import Cocoa
@kpapiez
kpapiez / toggle-grayscale
Created January 7, 2016 18:21 — forked from wbolster/toggle-grayscale
AppleScript to toggle grayscale display (for Mac OSX 10.11 El Capitan)
tell application "System Preferences"
set current pane to pane "Accessibility"
end tell
tell application "System Events"
tell process "System Preferences"
click checkbox "Use grayscale" of window 1
end tell
end tell
tell application "System Events"
quit
@ryanolsonk
ryanolsonk / top100.csv
Created January 11, 2016 04:01
Top 100 Apps
Rank Name Bundle ID Version Min iOS Version SDK Version Uses Swift Universal App VC Based Status Bar Management Xcode Version
1 Candy Crush com.midasplayer.apps.candycrushjellysaga1 1.6.5 6 iphoneos8.0 No Universal Global 610
2 Piano Tiles 2 com.cmplay.tiles2 1.1.7 7 iphoneos9.2 No Universal Global 720
3 Messenger com.facebook.Messenger 52 7 iphoneos9.1 No Universal VC Based 710
4 Instagram com.burbn.instagram 7.13.1 7 iphoneos9.1 No iPhone Only VC Based 710
5 YouTube com.google.ios.youtube 10.49.13 7 iphoneos8.4 No Universal Global 640
6 Snapchat com.toyopagroup.picaboo 9.21.1 7 iphoneos9.0 No iPhone Only Global 701
7 Meltdown com.robtop.geometrydashmeltdown 1 6 iphoneos9.1 No Universal Global 710
8 Facebook com.facebook.Facebook 46 7 iphoneos9.1 No Universal Global 710
9 Netflix com.netflix.Netflix 7.2.4 7 iphoneos9.0 No Universal VC Based 700
@citrusui
citrusui / fancybutton.md
Last active June 13, 2023 17:58
How to add a fancy Direct Message button to your Tweets https://twitter.com/citrusui/status/719279185123012609

How to add a fancy Direct Message button to your Tweets

Step 1: Go to tweeterid.com and enter your username.

Step 2: Copy your user ID from the previous website.

Step 3: Copy the following URL:

// @discardableResult to be added
// @noescape needs to move to type annotation
// needs to add _ for item
public func with<T>(item: T, @noescape update: (inout T) throws -> Void) rethrows -> T {
var this = item; try update(&this); return this
}
@Explorare
Explorare / com.google.Chrome.mobileconfig
Last active November 28, 2022 05:54
Add local chrome extensions to whitelist in MacOS. https://hencolle.com/2016/10/16/baidu_exporter/
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PayloadContent</key>
<array>
<dict>
<key>PayloadContent</key>
<dict>
<key>com.google.Chrome</key>

WannaCry|WannaDecrypt0r NSA-Cyberweapon-Powered Ransomware Worm

  • Virus Name: WannaCrypt, WannaCry, WanaCrypt0r, WCrypt, WCRY
  • Vector: All Windows versions before Windows 10 are vulnerable if not patched for MS-17-010. It uses EternalBlue MS17-010 to propagate.
  • Ransom: between $300 to $600. There is code to 'rm' (delete) files in the virus. Seems to reset if the virus crashes.
  • Backdooring: The worm loops through every RDP session on a system to run the ransomware as that user. It also installs the DOUBLEPULSAR backdoor. It corrupts shadow volumes to make recovery harder. (source: malwarebytes)
  • Kill switch: If the website www.iuqerfsodp9ifjaposdfjhgosurijfaewrwergwea.com is up the virus exits instead of infecting the host. (source: malwarebytes). This domain has been sinkholed, stopping the spread of the worm. Will not work if proxied (source).

update: A minor variant of the viru

@X140Yu
X140Yu / cal.sh
Last active September 16, 2017 16:36
A shell script which helps you calculate a specific person's contribution
#!/bin/sh
if [ "$#" -ne 1 ]; then
echo "Usage: $0 Author-Name"
exit 1
fi
echo Total Commit: $(git log --author=$1 --pretty=tformat: --oneline | wc -l)
git log --author=$1 --pretty=tformat: --numstat | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf "Added lines: %s, Removed lines: %s, Total lines: %s\n", add, subs, loc }'