Skip to content

Instantly share code, notes, and snippets.

View ruyaoyao's full-sized avatar
❣️

Shiny ruyaoyao

❣️
View GitHub Profile
@Karunamon
Karunamon / guide.md
Last active June 24, 2024 19:04
Nintendo Switch reverting to stock with no NAND backup

Restoring your Switch to stock WITHOUT a NAND backup.

Just use Haku33, it is this but automated and safe. There is no reason for you to manually follow this process, it is dangerous!

Procedure by Nevercholt Tech (https://www.youtube.com/watch?v=gVjF_MKjSv8) - transcribed by Karunamon

Note: This procedure is somewhat advanced and, if you screw up, you are likely to hard brick your switch. *Proceed with caution!

Also note that this is a full reset. All save data, installed apps, everything will be lost.

@dinhchi27
dinhchi27 / Key Sublime Text 3.2.1 Build 3207 - Sublime Text 3 License Key
Last active June 21, 2024 20:09
Key Sublime Text 3.2.1 Build 3207 - Sublime Text 3 License Key
Key Sublime Text 3.2.1 Build 3207
----- BEGIN LICENSE -----
Member J2TeaM
Single User License
EA7E-1011316
D7DA350E 1B8B0760 972F8B60 F3E64036
B9B4E234 F356F38F 0AD1E3B7 0E9C5FAD
FA0A2ABE 25F65BD8 D51458E5 3923CE80
87428428 79079A01 AA69F319 A1AF29A4
A684C2DC 0B1583D4 19CBD290 217618CD
@wmertens
wmertens / router.jsx
Last active August 10, 2017 11:14
Wrapper for react-router v4 with an API more to my tastes
import React, {Component, PropTypes} from 'react'
import {Link, Route as OrigRoute, Switch, Redirect, BrowserRouter as Router, withRouter} from 'react-router-dom'
// Subscribes a child to history updates, passing the current location as a prop
// This is needed to work around the React context API not updating all children
// See https://github.com/ReactTraining/react-router/issues/4629#issuecomment-284218493
export class LocationListener extends Component {
static contextTypes = {
history: PropTypes.object,
}
class Queue {
constructor(limit, ...options) {
let timeout, delay;
if (options.length) {
if (typeof options[0] === 'object') {
({timeout, delay} = options[0]);
}
else {
[timeout, delay] = options;
}
@timotgl
timotgl / uninstall-razer-synapse.sh
Last active June 14, 2024 08:59
How to fully uninstall Razer Synapse 2 on OS X (10.11-10.13) (El Capitan, Sierra, High Sierra) without using Razer's official uninstall tool
# How to uninstall Razer Synapse 2 ( https://www.razerzone.com/synapse-2 )
# on OS X (10.11-10.13) (El Capitan, Sierra, High Sierra)
# without using Razer's official uninstall tool.
# Tested on OS X 10.11.5 in July 2016.
# Edited with additional steps for later OS X versions,
# contributed by commenters on this gist.
# Step 1: In your terminal: stop and remove launch agents
launchctl remove com.razer.rzupdater
@Restuta
Restuta / the-bind-problem.jsx
Last active March 16, 2024 00:22
React, removeEventListener and bind(this) gotcha
/* Sometimes it's pretty easy to run ito troubles with React ES6 components.
Consider the following code: */
class EventStub extends Component {
componentDidMount() {
window.addEventListener('resize', this.onResize.bind(this)); //notice .bind
}
componentWillUnmount() {
window.removeEventListener('resize', this.onResize.bind(this));
@yang-wei
yang-wei / note.md
Last active April 19, 2021 14:49
Vue.js tips and tricks

Notes: All the examples below are only tested on Vue.js 1.0 (above).

Notes: The examples below use ES6 so it's recommended to use browserify or webpack to easily integrate babel.

when or where can we use this.$el

When you need to access DOM attribute, be careful with the lifecycle. Vue.js has a few useful lifecycle hooks.

Let's say we want to scroll our component to the bottom (imagine it's a long list with overflow-y: auto) once it's instantiate.

@rahuljiresal
rahuljiresal / openshift-node-force-domain.js
Last active July 22, 2016 08:53
This is a middleware for Connect and Express that redirects any requests to a default domain. Based on https://github.com/goloroden/node-force-domain, modified to work on Openshift platform.
/*
Openshift uses haproxy (haproxy.org) as a front proxy to route request to instances of the app.
This proxy does the job of unwrapping https and sets the 'x-forwarded-proto' header.
Because of this, the Node.JS app never sees the actual protocol of the request, unless it checks the presence of this header.
I modified the code written by goloroden (https://github.com/goloroden/node-force-domain) to check this header instead of ports.
This gist does exactly what his code does, except checks for actual protocol instead of relying on the port for the protocol.
*/
var rewrite = function (route, options) {
options = _.defaults({

自我學習,以目前限有材料規劃的 learning path

這只是工具的用法,別忘了吸收資料科學的知識 yo

hadoop 入門速記

  1. 用 Hadoop MapReduce Framework 寫程式出來跑得動,跟你想的結果一樣
  2. 參考 popcorny 分享的 word count 專案 https://github.com/popcornylu/hadoop-wordcount
  3. Map Reduce 演算法概念
  4. 弄懂 Map Reduce 演算法各資料處理階段對應至 Hadoop MapReduce Framework 上的 Job Template (之後最佳化會用到)
@Maxim-Filimonov
Maxim-Filimonov / Codeship deployment script
Last active July 19, 2016 02:38
Precompile assets on codeship
# Assuming that you have followed all the instructions from https://github.com/rumblelabs/asset_sync
# Put this in your deployment script
# Choose any environment here the important part is that your environment is using the same bucket for all environments
# than you only need to precompile assets once
RAILS_ENV=staging bundle exec rake assets:precompile
# You need to set git credentials otherwise it won't be able to commit
git config --global user.email "codeship@codeship.com"
git config --global user.name "Codeship Server"
# Add your manifest file so that rails can find digested version of files