Skip to content

Instantly share code, notes, and snippets.

@abdul-jabbar01
abdul-jabbar01 / quote-of-the-day.sh
Created Aug 22, 2019
Bash script to send motivational quotes daily in slack channel
View quote-of-the-day.sh
#!/bin/bash
#This script uses the API of http://quotes.rest to get the inspirational quotes. And then send it to slack channel daily
#You can set the bash script in the cronjob. And the cronjob will run this script daily.
#Slack Configuration
USERNAME=Motivator
TEXT="It's time to motivate you"
CHANNEL="#abduljabbar"
HOOK=https://hooks.slack.com/services/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
@rust-play
rust-play / playground.rs
Created Aug 22, 2019
Code shared from the Rust Playground
View playground.rs
use std::io::Write;
pub fn feed_type_post_body(kind: bool) -> for<'w> fn(into: &'w mut dyn Write) -> Box<dyn Write + 'w> {
match kind {
true => feed_rss_post_body,
false => feed_rss_post_body,
}
}
pub fn feed_rss_post_body<'w>(into: &'w mut dyn Write) -> Box<dyn Write + 'w> {
View insert_data
INSERT INTO dbo.TEST
([ID],[COL1],[COL2],[COL3],[COL4],[COL5],[StartTime],[EndTime])
VALUES
(1,'a','b','c','d','e',GETDATE(),GETDATE()),
(2,'a2','b2','c2','d2','e2',GETDATE(),GETDATE()),
(3,'a3','b3','c3','d3','e3',GETDATE(),GETDATE()),
(4,'a4','b4','c4','d4','e4',GETDATE(),GETDATE()),
(5,'a5','b5','c5','d5','e5',GETDATE(),GETDATE()),
(6,'a6','b6','c6','d6','e6',GETDATE(),GETDATE()),
(7,'a7','b7','c7','d7','e7',GETDATE(),GETDATE()),
View Comments.py
#Comentário de uma linha
'''
Comentário de multiplas linhas
Comentário de multiplas linhas
'''
@CodersArts
CodersArts / mdi.py
Created Aug 22, 2019
Multiple windows in PyQT5
View mdi.py
import sys
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
from PyQt5 import QtWidgets, uic
class MainWindow(QtWidgets.QMainWindow):
count = 0
@HugsLibRecordKeeper
HugsLibRecordKeeper / output_log.txt
Created Aug 22, 2019
Rimworld output log published using HugsLib
View output_log.txt
Log uploaded on Thursday, August 22, 2019, 7:05:21 PM
Loaded mods:
Core: (no assemblies)
RimThemesLite: 0Harmony(1.2.0.1), LibAPNG(0.2.6979.15011), RimThemesLite(2019.3.1.0)
HugsLib[6.0.1]: 0Harmony(1.2.0.1), HugsLib(1.0.0.0)
RIMMSLoadUp: 0Harmony(1.2.0.1), RIMMSLoadUp(1.0.7040.29929)
Humanoid Alien Races 2.0: 0Harmony(1.2.0.2), AlienRace(1.0.0.0)
Combat Extended: 0Harmony(1.2.0.1), CombatExtended(0.18.1.1)
Core SK: 0Harmony(1.2.0.1), ArchitectSense(1.0.6905.6874), Compatibility_AlienRaces(1.0.6978.14176), Compatibility_CombatExtended(1.0.7037.41287), Core_SK(1.0.6901.14209), FertileFields(1.0.6905.6873), Mending(1.0.7114.20269), Quarry(0.0.0.0), Rainbeau's Archipelagos(1.0.6903.8520), RightToolForJob(1.0.7086.33308), UniversalFermenter(0.0.0.0)
EdB Prepare Carefully: 0Harmony(1.2.0.1), EdBPrepareCarefully(1.0.11.0)
View FunctionalPropertyModifiers.cpp
#include "FunctionalPropertyModifiers.h"
void fpmCallStore::CallAll(double time)
{
for (auto i : m_FunctionCallMap)
{
const fpmFunctionCalls& calls = i->value;
calls.call_all_fn(i->key, calls, time);
View query
use lib ‘data/all-modules/cpan/FCO/Red/lib’; use Red; model Bla { has UInt $.id is serial }; my $*RED-DB = database "SQLite"; Bla.^create-table; Bla.^create for ^5; .say for Bla.^all
View server.json
{
"feed": [
{
"id": 1,
"image": "https://rocketseat-cdn.s3-sa-east-1.amazonaws.com/instagram-clone/1.jpeg",
"small": "https://rocketseat-cdn.s3-sa-east-1.amazonaws.com/instagram-clone/small/1.jpeg",
"aspectRatio": 0.834,
"description": "Working hard at Rocketseat!",
"authorId": 1
},
View query
use lib ‘data/all-modules/cpan/FCO/Red/lib’; use Red; model Bla { has Unit $.id is serial }; my $*RED-DB = database "SQLite"; Bla.^create-table; Bla.^create for ^5; .say for Bla.^all
You can’t perform that action at this time.