Skip to content

Instantly share code, notes, and snippets.

// store and display a histogram
// input = [1, 2, 3, 4, 5, 10, 11, 11]
// bin_size = 5
// first bin [1, 2, 3, 4] -> 4
// second bin [5] -> 1
// ...
// 0 | ####
// 5 | #
/*
https://cataas.com/cat/says/te
*/
class CatSearch extends React.Component {
constructor(props) {
super(props)
this.state = {
@3on
3on / config.git
Created December 13, 2019 00:49
Git config
alias.co=checkout
alias.st=status
alias.local=for-each-ref --sort=committerdate refs/heads/ --format='%(color: red)%(committerdate:short) %(color: cyan)%(refname:short)'
alias.trash=stash save -u trash
alias.update=!git fetch origin develop && git rebase origin/develop
user.name=Jr
user.email=jr@example.com
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@3on
3on / gist:6c0be14eac8a9c5ec606f85ee20a2eae
Created April 30, 2018 22:56
MBP late 2011 AMD GPU disabling
## Links
* https://apple.stackexchange.com/questions/267581/gpu-problem-boot-hangs-on-grey-screen/295805#295805
* https://forums.macrumors.com/threads/force-2011-macbook-pro-8-2-with-failed-amd-gpu-to-always-use-intel-integrated-gpu-efi-variable-fix.2037591/
@3on
3on / index.html
Created March 11, 2018 22:27
CSS float and clearfix || https://jsbin.com/niturag
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
.parent {
border: 2px solid #888;
/* height: 124px; */ /* DOTH it works */
<?php
function mysql_real_escape_string($str) {
return $str;
}
function mysql_query($sql) {
return mysqli_query(Mysql::$link, $sql);
}
function mysql_fetch_assoc($result) {
@3on
3on / .inputrc
Created February 14, 2018 03:15
History search on arrows
## arrow up
"\e[A":history-search-backward
## arrow down
"\e[B":history-search-forward
## Found here: https://askubuntu.com/questions/59846/bash-history-search-partial-up-arrow
diff --git a/Podfile b/Podfile
index c41dae5..9b4235b 100644
--- a/Podfile
+++ b/Podfile
@@ -25,14 +25,6 @@ pod 'MediaLibraryKit-unstable'
pod 'MobileVLCKit-unstable', '3.0.0a10'
end
-post_install do |installer_representation|
- installer_representation.pods_project.build_configurations.each do |config|
@3on
3on / anti-virus.sh
Created April 16, 2016 20:05
Clean you mac from MacCleaner/Mackeeper malware in 3 steps.
# 1. List all the daemons running on you mac that are not published by apple.
# Search on google any name that you do not trust.
# MacKeeper has at least one with a strange name.
launchctl list | grep -v com.apple
# 2. Remove all the suspecious daemons.
# You won't be able to simply kill -9, they all restart each other and redownload themselves.
launchctl remove com.malware.something
# 3. Remove all associated files