-
https://golangresources.com/ - all resources
-
https://relistan.com/continue-statement-with-labels-in-go - Use continue in go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { Client } = require('whatsapp-web.js'); | |
const qrCode = require('qrcode'); | |
const http = require('http'); | |
const request = require('request'); | |
const client = new Client(); | |
const stop = "\n\n===============\nBalas pesan ini dengan *stop* untuk berhenti automasi Covid19" | |
const penggunaAksi = new Map(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Experiment to confirm the effect of stratify option in Scikit Learn, tran_test_split() method. | |
# by Shayan Amani | |
from sklearn.model_selection import train_test_split | |
import pandas as pd | |
raw_data = pd.read_csv("codebase/adrel/dataset/train.csv") | |
cnt = raw_data.groupby('label').count() | |
''' experiment begins ''' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait CreatesWithLock | |
{ | |
public static function updateOrCreate(array $attributes, array $values = []) | |
{ | |
return static::advisoryLock(function () use ($attributes, $values) { | |
// emulate the code found in Illuminate\Database\Eloquent\Builder | |
return (new static)->newQuery()->updateOrCreate($attributes, $values); | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const firstPromise= () => (new Promise((resolve,reject) => { | |
setTimeout(() =>{ resolve('first Promise')},1000) | |
})) | |
const secondPromise = () => ( new Promise((resolve,reject) =>{ | |
setTimeout(() =>{ resolve('second Promise')},1000) | |
})) | |
const thirdPromise = () => ( new Promise((resolve,reject) =>{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# create sdk folder | |
export ANDROID_HOME=/opt/android-sdk-linux | |
sudo mkdir -p $ANDROID_HOME | |
# install openjdk | |
sudo apt-get install openjdk-8-jdk | |
# download android sdk | |
cd $ANDROID_HOME | |
sudo wget https://dl.google.com/android/repository/tools_r25.2.3-linux.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Corpus | |
>> from nltk.corpus import brown | |
>>> brown.words()[0:10] | |
sentence & word tokenization | |
part-of-speech tagging | |
chunking & named entity recognition | |
text classification | |
many included corpora |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') { | |
if (isset($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_METHOD']) && ( | |
$_SERVER['HTTP_ACCESS_CONTROL_REQUEST_METHOD'] == 'POST' || | |
$_SERVER['HTTP_ACCESS_CONTROL_REQUEST_METHOD'] == 'DELETE' || | |
$_SERVER['HTTP_ACCESS_CONTROL_REQUEST_METHOD'] == 'PUT' )) { | |
header('Access-Control-Allow-Origin: *'); | |
header("Access-Control-Allow-Credentials: true"); | |
header('Access-Control-Allow-Headers: X-Requested-With'); | |
header('Access-Control-Allow-Headers: Content-Type'); |
Inspired by dannyfritz/commit-message-emoji
See also gitmoji.
Commit type | Emoji |
---|---|
Initial commit | 🎉 :tada: |
Version tag | 🔖 :bookmark: |
New feature | ✨ :sparkles: |
Bugfix | 🐛 :bug: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Here is a sample of the URLs this regex matches: (there can be more content after the given URL that will be ignored) | |
// http://youtu.be/dQw4w9WgXcQ | |
// http://www.youtube.com/embed/dQw4w9WgXcQ | |
// http://www.youtube.com/watch?v=dQw4w9WgXcQ | |
// http://www.youtube.com/?v=dQw4w9WgXcQ | |
// http://www.youtube.com/v/dQw4w9WgXcQ | |
// http://www.youtube.com/e/dQw4w9WgXcQ | |
// http://www.youtube.com/user/username#p/u/11/dQw4w9WgXcQ |
NewerOlder