Skip to content

Instantly share code, notes, and snippets.

@badmofo
badmofo / coinlist.py
Last active September 23, 2023 20:37
CoinList Pro Python3 API
'''
Copyright (c) 2020 Lucas Ryan
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so.
@veelenga
veelenga / imagemagick.bash
Last active May 17, 2022 23:43 — forked from bensie/imagemagick.bash
ImageMagick Static Binaries with HEIC support for AWS Lambda
#!/usr/bin/env bash
# Must be run on an Amazon Linux AMI that matches AWS Lambda's runtime which can be found at:
# https://docs.aws.amazon.com/lambda/latest/dg/current-supported-versions.html
#
# As of Jan 10, 2019, this is:
# Amazon Linux AMI 2017.03.1.20170812 x86_64 HVM GP2 (ami-4fffc834)
#
# Lambda includes ImageMagick 6.7.8-9 preinstalled, so you need to prepend PATH
# with the folder containing these binaries in your Lambda function to ensure
@sooch
sooch / laravel_query_builder_lock.md
Last active July 4, 2022 06:53
Laravelの悲観的ロックについて

共有ロック

クエリビルダは、SELECT文で「悲観的ロック」を行うための機能をいくつか持っています。SELECT文を実行する間「共有ロック」をかけたい場合は、sharedLockメソッドをクエリに指定して下さい。共有ロックはトランザクションがコミットされるまで、SELECTしている行が更新されることを防ぎます。

DB::table('users')
  ->where('votes', '>', 100)
  ->sharedLock()
  ->get();
const functions = require('firebase-functions');
const rp = require('request-promise');
const projectId = process.env.GCP_PROJECT;
const region = 'us-central1';
// GCF の List API を利用するためのサービスアカウント
// service account をリポジトリに含めたくない場合は下記のように機密データを取得する
// 設定方法: https://github.com/firebase/firebase-tools/issues/406#issuecomment-353017349
const serviceAccount = functions.config().list.cert;
@sandabu
sandabu / Example.php
Last active February 7, 2022 12:14
Stripe API Japanese Error Messages
<?php
//Composerでstripe/stripe-php をrequire済み
require_once __FILE__. './jp.php';
try{
Stripe\Stripe::setApiKey('sk_test_YOUR_KEY');
Stripe\Charge::create([]);
}catch(Stripe\Error\Base $e) {
$err = $e->getJsonBody()['error'];
if(key_exists('code', $err)) {
@DawidMyslak
DawidMyslak / vue.md
Last active April 22, 2024 12:49
Vue.js and Vuex - best practices for managing your state

Vue.js and Vuex - best practices for managing your state

Modifying state object

Example

If you have to extend an existing object with additional property, always prefer Vue.set() over Object.assign() (or spread operator).

Example below explains implications for different implementations.

@windyinsc
windyinsc / ffmpeg-cheatsheet.md
Last active January 30, 2025 08:40 — forked from larvata/ffmpeg-cheatsheet.md
ffmpeg notes

ffmpeg Cheatsheet

  • Join TS Files
  • Convert TS to MP4
  • Download Online AES-128 Encrypted HLS video
  • Convert Video to GIF
  • Extract Audio and Convert it to MP3
  • Burn Subtitles into Video

Join TS Files

@gdurastanti
gdurastanti / parallels-reset.sh
Created August 9, 2017 14:00
Reset Parallels' trial
#!/bin/sh
# Reset Parallels Desktop's trial and generate a casual email address to register a new user
rm /private/var/root/Library/Preferences/com.parallels.desktop.plist /Library/Preferences/Parallels/licenses.xml
jot -w pdu%[email protected] -r 1
@rongyi
rongyi / stardict2txt.py
Last active December 4, 2024 15:40
convert a stardict dictionary to txt
#!/usr/bin/python
# -*- coding: utf-8 -*-
import struct
import types
import gzip
class IfoFileException(Exception):
"""Exception while parsing the .ifo file.
Now version error in .ifo file is the only case raising this exception.
@huytd
huytd / .tmux.conf
Created February 24, 2017 18:03
Clean setup
set -g default-terminal "xterm-256color"
set-option -ga terminal-overrides ",xterm-256color:Tc"
set -g prefix C-x
unbind-key C-x
bind-key C-2 send-prefix
bind \ split-window -h -c '#{pane_current_path}'
bind / split-window -v -c '#{pane_current_path}'
# Copy-paste integration