Skip to content

Instantly share code, notes, and snippets.

@xaadu
xaadu / hello.html
Last active May 1, 2024 12:50
Ostad | Python, Django, React | Batch 1 | Module 1 | Session 1
<!DOCTYPE html>
<html>
<head>
<title>This is a title</title>
<style>
.div1 {
border: 5px solid red;
text-align: center;
@manniru
manniru / databaseService.php
Created August 16, 2019 08:30 — forked from WengerK/databaseService.php
Drupal 8 - Print raw SQL queries for debugging
<?php
/**
* Debugging using the database connection.
*/
/** @var \Drupal\Core\Database\Connection */
$connection = \Drupal::service('database');
$query = $connection->select('node', 'node');
$query->fields('node', ['nid'])
@manniru
manniru / ContactForm-basic.php
Created August 16, 2019 08:29 — forked from WengerK/ContactForm-basic.php
Drupal 8 — Inline validation in forms
<?php
/**
* @file
* Contains \Drupal\my_contact\Form\ContactForm.
*/
namespace Drupal\my_contact\Form;
use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;
@manniru
manniru / d8_snippets.md
Created August 12, 2019 17:08 — forked from mgalang/d8_snippets.md
Drupal 8 snippets

Create link from text and url

$url = Url::fromRoute($route_name);
$link = Link::fromTextAndUrl($text, $url);

Create link from route

$link = Link::createFromRoute('Link Text', 'route_name')->getUrl();
<?php
/**
* @file
* Contains lotus.module.
*/
use Drupal\user\Entity\User;
/**
https://dl-ssl.google.com/tag/s/appguid%3D%7B8A69D345-D564-463C-AFF1-A69D9E530F96%7D%26iid%3D%7B739A42D5-7A93-1BFE-A053-81D56ACD6752%7D%26lang%3Den%26browser%3D4%26usagestats%3D0%26appname%3DGoogle%2520Chrome%26needsadmin%3Dfalse%26installdataindex%3Ddefaultbrowser/update2/installers/ChromeStandaloneSetup.exe
@sebjvidal
sebjvidal / ViewController.swift
Created April 30, 2024 15:50
Apple Journal Calendar UI Demo
//
// ViewController.swift
// Journal-Calendar-Demo
//
// Created by Seb Vidal on 30/04/2024.
//
import UIKit
class ViewController: UIViewController {
@manniru
manniru / ChromeOffline.txt
Created August 12, 2019 06:37 — forked from alex-endfinger/ChromeOffline.txt
Chrome Offline
https://dl-ssl.google.com/tag/s/appguid%3D%7B8A69D345-D564-463C-AFF1-A69D9E530F96%7D%26iid%3D%7B739A42D5-7A93-1BFE-A053-81D56ACD6752%7D%26lang%3Den%26browser%3D4%26usagestats%3D0%26appname%3DGoogle%2520Chrome%26needsadmin%3Dfalse%26installdataindex%3Ddefaultbrowser/update2/installers/ChromeStandaloneSetup.exe
@championofblocks
championofblocks / wav-mp3
Last active May 1, 2024 12:49
Command line bash to convert all wav to mp3
for i in *.wav; do lame -b 320 -h "${i}" "${i%.wav}.mp3"; done
exports.countryList = () => {
return [
{"name": "Australia", "code": "AU"},
{"name": "Austria", "code": "AT"},
{"name": "Azerbaijan", "code": "AZ"},
{"name": "Bahamas", "code": "BS"},
{"name": "Bahrain", "code": "BH"},
{"name": "Bangladesh", "code": "BD"},
{"name": "Barbados", "code": "BB"},
{"name": "Belarus", "code": "BY"},