Instantly share code, notes, and snippets.

View Download-Shopify-CDN-Assets.md

Instructions

  1. Go to your Shopify admin/settings/files page
  2. Open your browser Dev tools, go to the console

Then, depending on the option you choose:

Option 1 - Download all the files directly (might crash you browser)

  1. Make sure your browser is set to download files automatically and doesn't ask for the download location every time
View Migrate Kodi Watched Status
# This might break all the things. Be careful.
#
# So I got a new Kodi media thing.
# And I wanted to create a new (clear) library.
# But I also wanted to keep watched status for things I'd watched.
# What follows are manual steps I took.
#
# dump the data on the old server
sqlite3 ~/.kodi/userdata/Database/MyVideos93.db
View High_Performance_Rust.md

Hello, Rust community!

My name is Hadrien and I am a software performance engineer in a particle physics lab. My daily job is to figure out ways to make scientific software use hardware more efficiently without sacrificing its correctness, primarily by adapting old-ish codebases to the changes that occured in the software and computing landscape since the days where they were designed:

  • CPU clock rates and instruction-level parallelism stopped going up, so optimizing code is now more important.
  • Multi-core CPUs went from an exotic niche to a cheap commodity, so parallelism is not optional anymore.
  • Core counts grow faster than RAM prices go down, so multi-processing is not enough anymore.
  • SIMD vectors become wider and wider, so vectorization is not a gimmick anymore.
View read-access.sql
-- Create a group
CREATE ROLE readaccess;
-- Grant access to existing tables
GRANT USAGE ON SCHEMA public TO readaccess;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO readaccess;
-- Grant access to future tables
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readaccess;
View aaaaaaaaaaa
<?php
date_default_timezone_set('Asia/Ho_Chi_Minh'); // lấy thời gian của việt nam
set_time_limit(0);
error_reporting(0);
$day = date("d"); // lấy ngày hôm nay
$month = date("m"); // lấy tháng hôm nay
$token = array("token 1","token 2");// cho token vào đây
$block = array("id 1","id 2"); // điền ID người mà bạn không muốn chúc tại đây
for($i=0;$i<count($token);$i++){
echo "-------------token số [$i]---------------<br>";
View _README.md

Two formatters i made, just for fun, both heavily based of the specdoc format.

The dragon_formatter.rb just says "HERE BE DRAGONS" after pending tests, and tells you the count in the summary.

the boss_formatter.rb just adds "LIKE A BOSS!" after passing tests, and when it says how long it took.

View Dockerfile
FROM golang:alpine
RUN apk update && apk upgrade && \
apk add --no-cache git zip
ARG TERRAFORM_VERSION
RUN git clone --single-branch --branch v${TERRAFORM_VERSION} https://github.com/hashicorp/terraform.git /go/src/github.com/hashicorp/terraform
RUN cd $GOPATH/src/github.com/hashicorp/terraform && echo $GOPATH && go install ./tools/terraform-bundle
View install-docker.sh
#!/usr/bin/env bash
# https://docs.docker.com/install/linux/docker-ce/ubuntu/
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable"
sudo apt-get update
sudo apt-get install docker-ce
# https://docs.docker.com/compose/install/
View delete_git_submodule.md

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
View operatorCharacters.swift
import Foundation
extension UnicodeScalar : ForwardIndexType {
public func successor() -> UnicodeScalar {
return UnicodeScalar(value + 1)
}
}
var operatorHeads: [UnicodeScalar] = Array("=-+!*%<>&|^~?".unicodeScalars)
operatorHeads += Array("\u{00A1}" ... "\u{00A7}")